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: 2352
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: 2352
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 Duplicate PARM on OUTFIL sancraig16 SYNCSORT 11 Thu Apr 05, 2018 10:25 pm
No new posts WRITE to VSAM giving duplicate RC picus_mf CICS 1 Fri Feb 23, 2018 2:52 pm
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 6 Wed Feb 21, 2018 7:21 pm
No new posts Why is SORT rearranging records that ... cschablow DFSORT/ICETOOL 4 Wed Jan 24, 2018 10:14 pm

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