Page 1 of 1

merging multiple record of same record length into one

PostPosted: Fri Sep 18, 2009 8:32 pm
by ranisupriya
Hi ,

I have various records eg.

Rec1 f1 f2 f4 f6
Rec2 f3 f5
Rec3 f7

where f1..f7 are unique fields. We know the length of each field. Whats the easiest way to merge all the records into one Rec as

REC f1 f2 f3 f4 f5 f6 f7

Re: merging multiple record of same record length into one

PostPosted: Sat Sep 19, 2009 1:38 am
by dick scherrer
Hello and welcome to the forum,

Will that grouping of data always be consistent (3 records per set with the same fields in each record)?

One way to do what you want is to read each of the 3 records into working-storage areas and after the 3rd record is read, STRING together the fields into the output area and write.