Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
oerdgie wrote: |
Hello Skolusu,
yes, there are only two records and I want to transpose them as rows into columns, in pairs.
In words...
Output file:
Record 1 : value 1 from the first record, value 1 from the second record
Record 2 : value 2 from the first record, value 2 from the second record
Record 3 : value 3 form the first record, value 3 from the second record
....and so on |
Well you can use RESIZE operator to Merge the 2 records into a single record and then transpose them.
Since you show a 5 byte values you will have a maximum of 13 values to be parsed. I used the REPEAT on parse which is a new feature of DFSORT z/OS V2R1 . If your shop doesn't have it , then you can code 13 parse fields and get the same results.
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
0;5001;10001;15001;20001;
5000;10000;15000;20000;25000;
//OUT DD SYSOUT=*
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(160) USING(CTL1)
//*
//CTL1CNTL DD *
OPTION COPY
INREC PARSE=(%01=(ENDBEFR=C';',FIXLEN=05,REPEAT=13)),
BUILD=(%01,%02,%03,%04,%05,%06,%07,%08,%09,%10,%11,%12,%13,80:X)
OUTFIL BUILD=(01,5,X,081,5,/,
06,5,X,086,5,/,
11,5,X,091,5,/,
16,5,X,096,5,/,
21,5,X,101,5,/,
26,5,X,106,5,/,
31,5,X,111,5,/,
36,5,X,116,5,/,
41,5,X,121,5,/,
46,5,X,126,5,/,
51,5,X,131,5,/,
56,5,X,136,5,/,
61,5,X,141,5,/,
66,5,X,146,5,/,
71,5,X,151,5,/,
76,5,X,156,5)
//* |
|
|