View previous topic :: View next topic
Author
Message
CICS fan New User Joined: 03 Apr 2008Posts: 82 Location: United States
I am using the folowing JCL to remove and retain duplicates from a 381 byte FB file.
Code:
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//INDD DD DSN=SITGRP.OUT.S0.PNR.D10203.T124922,DISP=SHR
//OUTDD DD DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,100)),
// DCB=(*.INDD),
// DSN=SITGRP.PNR.D10203.T124922.NODUPB
//DUPS DD DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,100)),
// DCB=(*.INDD),
// DSN=SITGRP.PNR.D10203.T124922.DUPSA
//SYSPRINT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(INDD) TO(OUTDD) ON(1,381,CH) -
FIRST DISCARD(DUPS)
//*
This is doing its job, but I do not want the records to be sorted in the OUTDD file. I want the records to retain their order. How can I do that by minimum tweaking of this job?
Please also note that the duplicates are random i.e. the 2nd record can be duplicate with 1000th record and so on.
Thanks in advance.
Shamik.
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Quote:
I want the records to retain their order.
Do you want to retain the order of records in both the output files or just in OUTDD alone?
Back to top
CICS fan New User Joined: 03 Apr 2008Posts: 82 Location: United States
Just the OUTDD. I figued one way of doing it, code below. But it does no longer have the duplicates retained in a seperate file. Any suggestion?
Code:
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//INDD DD DSN=SITGRP.OUT.S0.PNR.D10203.T124922,DISP=SHR
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(100,100)),
// DISP=(,PASS)
//OUTDD DD DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,100)),
// DCB=(*.INDD),
// DSN=SITGRP.PNR.D10203.T124922.NODUPY
//TOOLIN DD *
SELECT FROM(INDD) TO(T1) ON(1,381,CH) FIRST USING(CTL1)
SORT FROM(T1) TO(OUTDD) USING(CTL2)
//CTL1CNTL DD *
INREC OVERLAY=(382:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
SORT FIELDS=(382,8,ZD,A)
OUTREC BUILD=(1,381)
Back to top
Arun Raj Moderator Joined: 17 Oct 2006Posts: 2481 Location: @my desk
Can you try this one.
Code:
//STEP1 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//INDD DD DSN= Input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(100,100)),
// DISP=(,PASS)
//OUTDD DD DSN= Output file
//DUPS DD DSN= Duplicates
//TOOLIN DD *
SELECT FROM(INDD) TO(T1) ON(1,381,CH) -
FIRST DISCARD(DUPS) USING(CTL1)
SORT FROM(T1) TO(OUTDD) USING(CTL2)
/*
//CTL1CNTL DD *
INREC OVERLAY=(382:SEQNUM,8,ZD)
//CTL2CNTL DD *
SORT FIELDS=(382,8,ZD,A)
OUTREC BUILD=(1,381)
Back to top
CICS fan New User Joined: 03 Apr 2008Posts: 82 Location: United States
Bingo Arun! you are star and a champ! It worked!
Back to top
Please enable JavaScript!