Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Duplicate removed, retained but do not want to be sorted

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
CICS fan

New User


Joined: 03 Apr 2008
Posts: 82
Location: United States

PostPosted: Fri Jul 23, 2010 10:49 am    Post subject: Duplicate removed, retained but do not want to be sorted
Reply with quote

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
View user's profile Send private message

Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jul 23, 2010 1:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS fan

New User


Joined: 03 Apr 2008
Posts: 82
Location: United States

PostPosted: Fri Jul 23, 2010 1:04 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2285
Location: @my desk

PostPosted: Fri Jul 23, 2010 1:11 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS fan

New User


Joined: 03 Apr 2008
Posts: 82
Location: United States

PostPosted: Fri Jul 23, 2010 1:18 pm    Post subject:
Reply with quote

Bingo Arun! you are star and a champ! It worked!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts SUM file with secondary sorted file cdelaf32 SYNCSORT 9 Mon Apr 25, 2016 10:20 pm
No new posts how to find the duplicate list RAVIGUPTA1990 DB2 6 Wed Mar 30, 2016 12:11 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us