Code: |
Input file 1xxxxxxxxxxxxxxxx -- > Header record 2xxxxxxxxxxxxxxxx -- > Header record 3xxxxxxxxxxxxxxxx -- > Header record . . . . 2007sort1234454545 set of records . . . . . 2005sort1234454545 2006sort1234454545 2008sort1234454545 2008sort1234454545 2007sort888999898 set of records . . . . . . . . 1xxxxxxxxxxxxxxxx -- > Trailer record 2xxxxxxxxxxxxxxxx -- > Trailer record 3xxxxxxxxxxxxxxxx -- > Trailer record . . . . End of file. Output file : 1xxxxxxxxxxxxxxxx -- > Header record 2xxxxxxxxxxxxxxxx -- > Header record 3xxxxxxxxxxxxxxxx -- > Header record . . . . 2007sort1234454545 set of records . . . . . 2007sort888999898 set of records . . . . . . . . 1xxxxxxxxxxxxxxxx -- > Trailer record 2xxxxxxxxxxxxxxxx -- > Trailer record 3xxxxxxxxxxxxxxxx -- > Trailer record . . . . End of file. |
Quote: |
1xxxxxxxxxxxxxxxx -- > Header record 2xxxxxxxxxxxxxxxx -- > Header record 3xxxxxxxxxxxxxxxx -- > Header record |
Code: |
//S1 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD * 1xxxxxxxxxxxxxxxx -- > Header record 2xxxxxxxxxxxxxxxx -- > Header record 3xxxxxxxxxxxxxxxx -- > Header record 2007sort1234454545 Record 01 A Record 02 B 2005sort1234454545 2006sort1234454545 2008sort1234454545 Record 01 X 2008sort1234454545 2007sort888999898 Record 01 C Record 02 D Record 03 3 1xxxxxxxxxxxxxxxx -- > Trailer record 2xxxxxxxxxxxxxxxx -- > Trailer record 3xxxxxxxxxxxxxxxx -- > Trailer record /* //OUT DD DSN=... output file (FB/80) //TOOLIN DD * SPLICE FROM(IN) TO(OUT) ON(85,8,ZD) KEEPNODUPS KEEPBASE - WITHALL WITH(1,80) USING(CTL1) /* //CTL1CNTL DD * INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:1,4,85:SEQNUM,8,ZD)), IFTHEN=(WHEN=(81,2,CH,EQ,C'20',OR,81,1,CH,EQ,C'1'), OVERLAY=(85:SEQNUM,8,ZD)), IFTHEN=(WHEN=NONE, OVERLAY=(93:SEQNUM,8,ZD, 85:85,8,ZD,SUB,93,8,ZD,M11,LENGTH=8)) OUTFIL FNAMES=OUT, INCLUDE=(81,4,CH,EQ,C'2007',OR,81,1,CH,EQ,C'1'), BUILD=(1,80) /* |
Code: |
1xxxxxxxxxxxxxxxx -- > Header record 2xxxxxxxxxxxxxxxx -- > Header record 3xxxxxxxxxxxxxxxx -- > Header record 2007sort1234454545 Record 01 A Record 02 B 2007sort888999898 Record 01 C Record 02 D Record 03 3 1xxxxxxxxxxxxxxxx -- > Trailer record 2xxxxxxxxxxxxxxxx -- > Trailer record 3xxxxxxxxxxxxxxxx -- > Trailer record |
Code: |
//S1 EXEC PGM=ICEMAN //SYSOUT DD SYSOUT=* //SORTIN DD * 1xxxxxxxxxxxxxxxx -- > Header record 2xxxxxxxxxxxxxxxx -- > Header record 3xxxxxxxxxxxxxxxx -- > Header record 2007sort1234454545 Record 01 A Record 02 B 2005sort1234454545 2006sort1234454545 2008sort1234454545 Record 01 X 2008sort1234454545 2007sort888999898 Record 01 C Record 02 D Record 03 3 1xxxxxxxxxxxxxxxx -- > Trailer record 2xxxxxxxxxxxxxxxx -- > Trailer record 3xxxxxxxxxxxxxxxx -- > Trailer record /* //OUT DD DSN=... output file (FB/80) //SYSIN DD * OPTION COPY INREC IFTHEN=(WHEN=GROUP, BEGIN=(1,2,CH,EQ,C'20',OR,1,1,CH,EQ,C'1'), PUSH=(81:1,4)) OUTFIL INCLUDE=(81,4,CH,EQ,C'2007',OR,81,1,CH,EQ,C'1'), BUILD=(1,80) /* |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours