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

reject duplicate records & write into another file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


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

PostPosted: Fri May 07, 2010 10:01 pm
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
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

Superior Member


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

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

Wish you could have searced the forum:
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: 496
Location: USA

PostPosted: Fri May 07, 2010 10:22 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top