	subroutine startbyte(istart,iposition,ilength_string)
	implicit integer (a-z)
	character*9 codes
	data codes /'XAOLWBFDH'/
	dimension lengths(9)
!
! length in bytes of  X A O L W B F D H
!
	data lengths /1,1,1,4,2,1,4,8,4/
!
! space for expanded macro definition
!
	character*65535	string
	common /special/ string
	character*1 zero
	data zero /0/

	ilength_string=index(string,zero)-1
	if (ilength_string.le.0) then
		type 10
 10		format(/' Unable to get definition for replacement '/)
		iposition=-1
		return
	 endif

	if (istart.lt.1 .or. istart.gt.ilength_string) then
		type 20
 20		format(/' Invalid record entry for replacement '/)
		iposition=-1
		return
	 endif


	iposition=0

	do i=1,istart-1
		icode=index(codes,string(i:i))
		if (icode.gt.0) then
			iposition=iposition+lengths(icode)
		 endif
	 enddo
	
	iposition=iposition+1
	return
	end
