Code: |
Input File #1
------------- abc,12346, 02,xyz pqr,12678, 06,x12 jhg,98798, 09,ui8 Input File #2 ------------- abc,12346567, 02,xyz pqr,12672345, 06,x12 jhg,98778908, 09,ui8 Input File #3 ------------- abc,123, 02,xyz pqr,126, 06,x12 jhg,987, 09,ui8 Output file #1 -------------- abc,12346,02,xyz pqr,12678,06,x12 jhg,98798,09,ui8 Output file #2 -------------- abc,12346567,02,xyz pqr,12672345,06,x12 jhg,98778908,09,ui8 Output file #3 -------------- abc,123,02,xyz pqr,126,06,x12 jhg,987,09,ui8 |
Code: |
//STEP1 EXEC PGM=ICETOOL //TOOLMSG DD SYSOUT=* //DFSMSG DD SYSOUT=* //IN DD DSN=... input file (FB/23) //T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS) //T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS) //S1 DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS) //TOOLIN DD * COPY FROM(IN) USING(CTL1) COPY FROM(T2) USING(CTL2) //CTL1CNTL DD * * Squeeze out the blanks INREC BUILD=(1,23,SQZ=(SHIFT=LEFT)) * Copy compressed records to T1 OUTFIL FNAMES=T1 * Convert first record to VB to get RDW length. OUTFIL FNAMES=T2,FTOV,VLTRIM=C' ',ENDREC=1 //CTL2CNTL DD * * Create a DFSORT symbol as: * outrcd,1,n * where n is rdw length - 4 = output lrecl length OUTFIL FNAMES=S1,VTOF,BUILD=(C'outrcd,1,', 1,2,BI,SUB,+4,TO=ZD,LENGTH=5,80:X) /* //STEP2 EXEC PGM=ICEMAN //SYSOUT DD SYSOUT=* //SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS) //SORTIN DD DSN=&&T1,DISP=(OLD,PASS) //SORTOUT DD SYSOUT=* //SYSIN DD * * Copy T1 to SORTOUT. Use the outrcd symbol to set the * LRECL for SORTOUT. OPTION COPY OUTREC BUILD=(outrcd) /* |
output generated using printer-friendly topic mod. All times are GMT - 5 Hours