Page 1 of 1

Divide a row into multiple rows

PostPosted: Wed Mar 02, 2016 3:38 pm
by agam3007
Hi All,
I have a row of LRECL 12500,i need to divide this row into different rows such that keys of the input rows comes in each row.

For example:-
Input records-
input record 1 : abcdefghi
input record 2 : xyziyufdk

Keys for record 1 :abc
Keys for record 1 :xyz

Expected Output
abcde
abcfg
abchi

xyziy
xyzuf
xyzdk

Please guide me the approach to do the above through JCL.

Thanks,
Agam

Re: Divide a row into multiple rows

PostPosted: Wed Mar 02, 2016 4:05 pm
by enrico-sorichetti
You were already asked to specify the SORT product used
since You did not care to reply the topic was moved to the IBM DFSORT section.

Re: Divide a row into multiple rows

PostPosted: Wed Mar 02, 2016 5:13 pm
by BillyBoyo
You need the slash-operator (/) in BUILD. This is only available in OUTFIL.

 OPTION COPY
  OUTFIL BUILD=(1,3,4,4169,
               /,
               1,3,4173,4169,
               /,
               1,3,8342,4169)


The slash-operator allows for multiple records to be written for one input record in an OUTFIL group.

I haven't check the values, just an example.