Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RPG that outputs variable length fields in a fixed length record file.

Status
Not open for further replies.

freierf

Programmer
Aug 2, 2009
1
US
I have a program that needs to output a file with variable length fields and fixed length records. Also, the fields need to be delimited by a hex character.
 
It looks to me like this isn't a true variable length field we're dealing with. So, in that case, simply define a DDS file with a single field in it, and concatenate the hex character as you go along.

For example (using hex 'FF' as the delimiter):

Record = Field1;
Record = %trim(record) + x'FF' + Field2;
...
Record = %trim(record) + x'FF' + Fieldx;
Write RecName;

In V5R3, the maximum length of a string (and, therefore, your record) is 65535 bytes.


-- Francis
I'd like to change the world, but I can't find the source code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top