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
 
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 3 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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