Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

reject duplicate records & write into another file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Fri May 07, 2010 9:50 pm    Post subject: reject duplicate records & write into another file
Reply with quote

Hi,

I want to reject the duplicate records from a file which can be achieved by SUM FIELDS=NONE. But i want the rejected records to be written to file 2.
Can somebody help.

Regards,
Nirmal
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri May 07, 2010 10:01 pm    Post subject:
Reply with quote

Though I did not get what exactly you are referring to by "reject", however, it looks like you need "sortxsum DDname", please search on xsum in JCL/DFsort part of the Forum. Hopefully it will serve your purpose.
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Fri May 07, 2010 10:04 pm    Post subject:
Reply with quote

Example
1111111111111111111A
1111111111111111111B
2222222222222222222A
3333333333333333333A
3333333333333333333B

the master output file should have
1111111111111111111A
2222222222222222222A
3333333333333333333A

and the duplicate reject file should have data
1111111111111111111B
3333333333333333333B
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri May 07, 2010 10:12 pm    Post subject:
Reply with quote

Wish you could have searced the forum:
http://ibmmainframes.com/viewtopic.php?t=966&highlight=xsum

if ice/synctool is your choice:

Code:

.
.
   SELECT FROM(INDD) TO(OUTDD)  ON(1,?,CH) ALLDUPS    -
          DISCARD(OTHERDD)
//INDD     DD DISP=SHR,DSN=...INPUT                   
//OUTDD    DD DISP=(,CATLG,DELETE),LRECL=XX,RECFM=XX,
//            SPACE=(XXX,(XX,XX),RLSE),               
//            DSN=...OUTPUT                           
//OTHERDD DD DISP=(,CATLG,DELETE),LRECL=XX,RECFM=XX,
//            SPACE=(XXX,(XX,XX),RLSE),               
//            DSN=DISCARDD                             
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Fri May 07, 2010 10:22 pm    Post subject:
Reply with quote

You can also code the following SyncSort for z/OS 1.3 job:
Code:
//STEP1 EXEC PGM=SORT
//SYSOUT  DD SYSOUT=* 
//SORTIN  DD *             
1111111111111111111A       
1111111111111111111B       
2222222222222222222A       
3333333333333333333A       
3333333333333333333B       
//SORTOUT  DD DSN=MASTER.OUTPUT
//SORTXDUP DD DSN=DUPLICATE.RECORDS 
//SYSIN    DD *           
   SORT FIELDS=(1,19,CH,A)
   DUPKEYS FIELDS=NONE,XDUP                       
/*
Back to top
View user's profile Send private message
kedianirmal

New User


Joined: 08 Feb 2008
Posts: 82
Location: Bangalore, India

PostPosted: Mon May 10, 2010 7:40 pm    Post subject:
Reply with quote

Thanks all
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us