IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Duplicate removed, retained but do not want to be sorted


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 2481
Location: @my desk

PostPosted: Fri Jul 23, 2010 1:02 pm
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
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: 2481
Location: @my desk

PostPosted: Fri Jul 23, 2010 1:11 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts Duplicate data in PUT CONTAINER using... CICS 4
Search our Forums:

Back to Top