I am using 3.14 to search for a copybook used in different programs. It found many entries and listed out. I used the below syncsort job to finalize the program the copybook used in.....
//STEP02 EXEC PGM=SORT
//SORTIN DD DSN=XXXXXX.SRCHFOR.LIST,
// DISP=SHR
//SORTOF1 DD DSN=XXXXX.XXXXX.OUT1,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=136,BLKSIZE=0)
//SORTOF2 DD DSN=XXXXX.XXXXX.OUT2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=136,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=1,
INCLUDE=(41,6,CH,EQ,C'STRING'),
OUTREC=(1,133,SEQNUM,3,ZD)
OUTFIL FILES=2,
INCLUDE=(1,133,SS,EQ,C'COPY'),
OUTREC=(1,133,SEQNUM,3,ZD)
/*
//*
//STEP03 EXEC PGM=SORT
//SORTIN DD DSN=XXXXX.XXXXX.OUT1,DISP=SHR
// DD DSN=XXXXX.XXXXX.OUT2,DISP=SHR
//SYSOUT DD SYSOUT=*
//OUT1 DD DSN=XXXXX.XXXXX.OUT4,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=133,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=(134,3,ZD,A),EQUALS
OUTFIL FNAMES=OUT1,OUTREC=(1,133)
/*
//SORTIN DD DSN=XXXXXX.SRCHFOR.LIST,
// DISP=SHR
//SORTOF1 DD DSN=XXXXX.XXXXX.OUT1,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=136,BLKSIZE=0)
//SORTOF2 DD DSN=XXXXX.XXXXX.OUT2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=136,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=1,
INCLUDE=(41,6,CH,EQ,C'STRING'),
OUTREC=(1,133,SEQNUM,3,ZD)
OUTFIL FILES=2,
INCLUDE=(1,133,SS,EQ,C'COPY'),
OUTREC=(1,133,SEQNUM,3,ZD)
/*
//*
//STEP03 EXEC PGM=SORT
//SORTIN DD DSN=XXXXX.XXXXX.OUT1,DISP=SHR
// DD DSN=XXXXX.XXXXX.OUT2,DISP=SHR
//SYSOUT DD SYSOUT=*
//OUT1 DD DSN=XXXXX.XXXXX.OUT4,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1),RLSE),
// DCB=(RECFM=FB,LRECL=133,BLKSIZE=0)
//SYSIN DD *
SORT FIELDS=(134,3,ZD,A),EQUALS
OUTFIL FNAMES=OUT1,OUTREC=(1,133)
/*
But, the output is giving all the remaining duplicates to the bottomest member!!
Please help.
Thanks.