Quote: |
I heard that the TRAILER option of the dfsort works only if the record length is 132 or less. |
Quote: |
They should contain say 150 records each depending on some sort criteria. |
Code: |
//S1 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //CON DD DSN=... input file1 // DD DSN=... input file2 // DD DSN=... input file3 //OUT1 DD DSN=&&O1,UNIT=SYSDA,SPACE=(CYL,(5,5)), //***> Use MOD for OUT1 // DISP=(MOD,PASS) //OUT2 DD DSN=&&O2,UNIT=SYSDA,SPACE=(CYL,(5,5)), //***> Use MOD for OUT2 // DISP=(MOD,PASS) //OUT3 DD DSN=&&O3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS) //TOOLIN DD * * Write one header record to OUT1 and OUT2 COPY FROM(CON) TO(OUT1,OUT2) USING(CTL1) * MOD the detail records and trailer records * to OUT1 and OUT2 COPY FROM(CON) USING(CTL2) /* //CTL1CNTL DD * * Write the first header record to OUT1 and OUT2. * Stop after reading/writing the header record. INCLUDE COND=(1,7,CH,EQ,C'hdrdate') OPTION STOPAFT=1 /* //CTL2CNTL DD * OUTFIL FNAMES=OUT1,REMOVECC, * OUT1: output file1. * Omit the header and trailer records. Keep the needed records. * Write the trailer as the last record. INCLUDE=(1,7,CH,NE,C'hdrdate',AND,1,4,CH,NE,C'CNTR',AND, additional conditions), TRAILER1=(2:'Trailer Counter',COUNT) OUTFIL FNAMES=OUT2,REMOVECC, * OUT2: output file2. * Omit the header and trailer records. Keep the needed records. * Write the trailer as the last record. INCLUDE=(1,7,CH,NE,C'hdrdate',AND,1,4,CH,NE,C'CNTR',AND, additional conditions), TRAILER1=(2:'Trailer Counter',COUNT) * OUT3: output file3. * Create file with all header and trailer records. OUTFIL FNAMES=OUT3,REMOVECC, INCLUDE=(1,7,CH,EQ,C'hdrdate',OR,1,4,CH,EQ,C'CNTR') /* |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours