by mainframegeek » Thu Oct 18, 2012 12:39 pm
I didn't try with section and trailer3 option.
Below mentioned is the JCL i used.
/***********************************************************
//STEP0001 EXEC PGM=ICETOOL
//***********************************************************
//*$ COPY DATASET FROM TAPE TO DISK
//***********************************************************
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN01 DD DSN=RT.DTP0107.DISK.RANGE.SORTED.TEST1,DISP=SHR
//IN02 DD DSN=RT.DTP0107.DISK.RANGE.SORTED.TEST1,DISP=SHR
//T1 DD DSN=RT.DTP0107.DISK.RANGE.SORTED.TEST4,
// SPACE=(CYL,(300,300)),UNIT=(SYSDA,15),
// DISP=(MOD,CATLG,CATLG)
//T2 DD DSN=RT.DTP0107.DISK.RANGE.SORTED.TEST5,
// SPACE=(CYL,(300,300)),UNIT=(SYSDA,15),
// DISP=(MOD,CATLG,CATLG)
//T3 DD DSN=RT.DTP0107.DISK.RANGE.SORTED.TEST6,
// SPACE=(CYL,(300,300)),UNIT=(SYSDA,15),
// DISP=(MOD,CATLG,CATLG)
//OUT1 DD DSN=RT.DTP0107.DISK.RANGE.SORTED.TEST7,
// DCB=(RECFM=FB,LRECL=8,BLKSIZE=0),
// SPACE=(CYL,(300,300)),UNIT=(SYSDA,15),
// DISP=(NEW,CATLG,CATLG)
//TOOLIN DD DSN=RT.DTP0107.TEST1(TOOLIN),DISP=SHR
//CTL1CNTL DD DSN=RT.DTP0107.TEST1(CTL1CNTL),DISP=SHR
//CTL2CNTL DD DSN=RT.DTP0107.TEST1(CTL2CNTL),DISP=SHR
//CTL3CNTL DD DSN=RT.DTP0107.TEST1(CTL3CNTL),DISP=SHR
//CTL4CNTL DD DSN=RT.DTP0107.TEST1(CTL4CNTL),DISP=SHR
CTL1CNTL
INREC FIELDS=(01,02,03,03)
SORT FIELDS=(03,03,ZD,A)
OUTREC FIELDS=(001:001,002,
003:003,003,
009:C'11')
CTL2CNTL
INREC FIELDS=(01,02,06,03)
SORT FIELDS=(03,03,ZD,D)
OUTREC FIELDS=(001:001,002,
006:003,003,
009:C'22')
CTL3CNTL
SORT FIELDS=(01,02,ZD,A)
SUM FIELDS=NONE
CTL4CNTL
OUTFIL FNAMES=OUT1,INCLUDE=(09,2,CH,EQ,C'11',OR,
09,2,CH,EQ,C'22',OR,
09,2,CH,EQ,C'12')
TOOLIN
COPY FROM(IN01) TO(T1) USING(CTL1)
COPY FROM(IN02) TO(T2) USING(CTL2)
COPY FROM(T1) TO(T3) USING(CTL3)
COPY FROM(T2) TO(T3) USING(CTL3)
SPLICE FROM(T3) TO(OUT1) ON(1,2,ZD) -
WITH(10,1) WITH(06,3) USING(CTL4) KEEPNODUPS
Input File(IN01 & IN02) (RT.DTP0107.DISK.RANGE.SORTED.TEST1)
11002005
11001004
11003006
12003004
12001002
13004005
T1(RT.DTP0107.DISK.RANGE.SORTED.TEST4)
11002 11
11001 11
11003 11
12003 11
12001 11
13004 11
Value 11 at 9th column is used for indicating that this data comes from IN01.
T2 (RT.DTP0107.DISK.RANGE.SORTED.TEST5)
11 00522
11 00422
11 00622
12 00422
12 00222
13 00522
Value 22 at 9th column is used for indicating that this data comes from IN02.
T3(RT.DTP0107.DISK.RANGE.SORTED.TEST6)
11002 11
11001 11
11003 11
12003 11
12001 11
13004 11
11 00522
11 00422
11 00622
12 00422
12 00222
13 00522
Output OUT1(RT.DTP0107.DISK.RANGE.SORTED.TEST7)
11002006
12003002
13004005
Desired output
11001006
12001004
13004005