|
Michael, I think you should test the contents of variable EDIREC. BTW, I think this code is wrong: > EDIREC = %SUBST(Record: StrSbs: EndSbs); > StrSbs=EndSbs+1; >>>>> EndSbs=EndSbs+80; EndSbs should always be 80, as it is the length of the substring. Regards, Carel Teijgeler *********** REPLY SEPARATOR *********** On 20-1-06 at 16:23 Ala, Michael A wrote: >I have a program parses a record into 80 byte blocks for EDI processing >The problem is I get a blank record in the 80 byte file > >FEDIFTPIFS IF F32766 DISK >FEDIINBOX O A F 80 DISK >D Field S 32766 Varying >Bit Stream In >D EDIREC DS 80 INZ >D EDIField 1 80A >D StrSbs S 4S 0 INZ(0001) >Start Substring >D EndSbs S 4S 0 INZ(0080) >End Substring >D RecordLen S 4S 0 >D Iterations S 3S 0 INZ(0) ># of Iterations >D ix S 3S 0 INZ(0) ># of Iterations >IEDIFTPIFS NS 01 >I 132766 Record >/free > // Read All of the FTP Records Break into 80 Char Bytes > // and Wite out EDI Order File > Dow not (%eof); > READ EDIFTPIFS; > if not (%eof); > RecordLen = %LEN(%TRIM(RECORD)); > Iterations = (RecordLen/80) + 1; > StrSbs = 1; > EndSbs = 80; > for ix = 1 to Iterations; > EDIREC = ' '; > EDIREC = %SUBST(Record: StrSbs: EndSbs); > Write EDIINBOX EDIREC; > StrSbs=EndSbs+1; > EndSbs=EndSbs+80; > endfor; > endif; // not eof > enddo; // Read of BRPPO > // End of Program > *inlr = *on ; > return ; >/end-free >OEDIINBOX DADD
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.