How do I convert a string to a 80 byte file

What’s the best way to convert a large string to a 80 byte file? I am using the generateFA service in the EDI Adapter package in IS 4.6. The output 997 is one string. I want to save this to a 80 byte file. Thanks for any input.

Rebecca

I’m completely baffled by this question. Can you elaborate on the specifics of what you’re trying to do?

The generateFA service generates a EDI X12 997. The output is a string that is more that 80 bytes. I want to save this string to a text file in 80 byte increments.

I would be glad to email you my output files offline if that would help. Thanks.

Rebecca

So, 80 characters per output file line, you mean?

Yes, that is correct.

You need a Java service to write to a file. Someone has posted the code for that in one of the discussions here and/or on Advantage.

For writing the string, here’s a rough approach:

 
set an index var to 0 
while index to end of string > 80 
{ 
  write chars from index to index+80  
  write a CR/LF (or just LF if Unix) 
  add 80 to index 
} 
write chars from index to end of string 
write a CR/LF if desired