I have a ICETOOL jcl which takes the input file and splits into two file (one with all the duplicates and other file without duplicates). The input file is of LRECL=80 with the key in colum 1 thru column 10. Can someone please suggest me to do the same using SYNCSORT? I also need slight modification in the output file with all the duplicates (file=OUTPUT.ALLDUPS), it should have a value of 'X' at column 30.
//SORT030 EXEC PGM=ICETOOL
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD DSN=INPUT.FILE1,
// DISP=SHR
//SORTOF1 DD DSN=OUTPUT.ALLDUPS,
// DISP=(,CATLG,CATLG),
// UNIT=SYSDA,
// SPACE=(CYL,(2,1),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//SORTOF2 DD DSN=OUTPUT.NODUPS,
// DISP=(,CATLG,CATLG),
// UNIT=SYSDA,
// SPACE=(CYL,(2,1),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOF1) ON(1,10,CH) ALLDUPS
SELECT FROM(SORTIN) TO(SORTOF2) ON(1,10,CH) NODUPS
/*
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD DSN=INPUT.FILE1,
// DISP=SHR
//SORTOF1 DD DSN=OUTPUT.ALLDUPS,
// DISP=(,CATLG,CATLG),
// UNIT=SYSDA,
// SPACE=(CYL,(2,1),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//SORTOF2 DD DSN=OUTPUT.NODUPS,
// DISP=(,CATLG,CATLG),
// UNIT=SYSDA,
// SPACE=(CYL,(2,1),RLSE),
// DCB=(RECFM=FB,LRECL=80)
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOF1) ON(1,10,CH) ALLDUPS
SELECT FROM(SORTIN) TO(SORTOF2) ON(1,10,CH) NODUPS
/*
Sample data:-
Input file:-
AAAAAAAAAA111111111111111
BBBBBBBBBB333333333333333
CCCCCCCCCC555555555555555
DDDDDDDDDD666666666666666
AAAAAAAAAA888888888888888
CCCCCCCCCC000000000000000
BBBBBBBBBB333333333333333
CCCCCCCCCC555555555555555
DDDDDDDDDD666666666666666
AAAAAAAAAA888888888888888
CCCCCCCCCC000000000000000
Output file with duplicates:-
AAAAAAAAAA111111111111111 X
AAAAAAAAAA888888888888888 X
CCCCCCCCCC555555555555555 X
CCCCCCCCCC000000000000000 X
AAAAAAAAAA888888888888888 X
CCCCCCCCCC555555555555555 X
CCCCCCCCCC000000000000000 X
Output file without duplicates:-
BBBBBBBBBB333333333333333
DDDDDDDDDD666666666666666
DDDDDDDDDD666666666666666