Apologies for not giving enough information.
This is a sample of the input data
=COLS> ----+----1----+----2----+----3----+----4----+----5--
000008 WAVE 3 15202510252825 15202510252825 KEY BB RD
000009 WAVE 3 15202510283461 15202510283461 KEY BB RD
000010 WAVE 3 15202510283461 15202510283461 KEY BB RD
000011 WAVE 3 15202510283488 15202510283488 KEY BB RD
000012 WAVE 3 15202510283488 15202510283488 KEY BB RD
Using this sample, from this input, I create three output files, every file contains columns 1 to 6 ("WAVE 3").
Output dataset 1 also contains columns 8 to 27.
Output dataset 2 also contains columns 28 to 41.
Output dataset 3 also contains columns 43 to 56.
So, each output dataset will contain 5 records.
Output datasets 1 and 2 will contain 3
distinct records.
Output dataset 3 will contain 1
distinct record.
To concentrate on output dataset 1, this will contain;
=COLS> ----+----1----+----2----+--
000001 WAVE 3 15202510252825
000002 WAVE 3 15202510283461
000003 WAVE 3 15202510283461
000004 WAVE 3 15202510283488
000005 WAVE 3 15202510283488
My question is, how do I remove the duplicate records from the output datasets, to give the following ?
=COLS> ----+----1----+----2----+--
000001 WAVE 3 15202510252825
000002 WAVE 3 15202510283461
000003 WAVE 3 15202510283488
A portion of my JCL follows
//STEP100 EXEC PGM=SORT,COND=(0,NE)
//SORTIN DD DSN=XXXX.SEQ.WAVE4,DISP=OLD
//CONNID DD DSN=XXXX.SEQ.CONNID.UNSRTD,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=27,RECFM=FB),
// DSORG=PS,
// SPACE=(CYL,(1,20),RLSE)
//INTCSTID DD DSN=XXXX.SEQ.INTCSTID.UNSRTD,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=21,RECFM=FB),
// DSORG=PS,
// SPACE=(CYL,(1,20),RLSE)
//CIN DD DSN=XXXX.SEQ.CIN.UNSRTD,
// DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=21,RECFM=FB),
// DSORG=PS,
// SPACE=(CYL,(1,20),RLSE)
//SORTMSG DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=CONNID,
BUILD=(1,27),
OUTFIL FNAMES=INTCSTID,
BUILD=(1,7,28,14)
OUTFIL FNAMES=CIN,
BUILD=(1,7,43,14)
//*
Above corrected to Output dataset 3 also contains columns 43 to 56.