Remove Duplicates + Original Record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Remove Duplicates + Original Record

Postby Eagle » Fri Nov 12, 2010 10:07 pm

Is there a way to use Syncsort to produce the following? All records with unique keys go to Output file 1 and all duplicate records plus the respective original record go to Output file 2.

Example:
Input
0001
0002
0002
0003
0004
0005
0005


Output file 1:
0001
0003
0004


Output file 2:
0002
0002
0005
0005
- Eagle -
User avatar
Eagle
 
Posts: 8
Joined: Thu Nov 04, 2010 8:11 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Remove Duplicates + Original Record

Postby Alissa Margulies » Sat Nov 13, 2010 12:08 am

Here is a SyncSort for z/OS 1.3 job that will produce the requested output:
//STEP1 EXEC PGM=SORT                           
//SORTIN  DD *                                   
0001                                             
0002                                             
0002                                             
0003                                             
0004                                             
0005                                             
0005                                             
//SORTXDUP DD DSN=&&XDUP,DISP=(NEW,PASS)     
//SORTOF01 DD DSN=&&OUT1,DISP=(NEW,PASS)         
//SORTOF02 DD DSN=UNIQUE.RECORDS
//SYSOUT   DD SYSOUT=*                           
//SYSIN    DD *                                 
   INREC OVERLAY=(81:X'F1')                     
   SORT FIELDS=(1,5,CH,A)                       
   DUPKEYS SUM=(81,1,ZD),XDUP                   
   OUTFIL FILES=01,INCLUDE=(81,1,ZD,GT,1)       
   OUTFIL FILES=02,INCLUDE=(81,1,ZD,EQ,1),BUILD=(1,80)       
/*                                               
//STEP2  EXEC PGM=SORT                           
//SORTIN01 DD DSN=&&XDUP,DISP=SHR                 
//SORTIN02 DD DSN=&&OUT1,DISP=SHR                 
//SORTOUT  DD DSN=ALLDUPS     
//SYSOUT   DD SYSOUT=*                           
//SYSIN    DD *                                   
   INREC BUILD=(1,80)                             
   MERGE FIELDS=(1,5,CH,A)                       
/*                                               
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Remove Duplicates + Original Record

Postby Eagle » Sat Nov 13, 2010 12:19 am

Thanks, again!

Is there a manual for Synctool? Using Synctool, I found the following example on another forum:

//S1    EXEC  PGM=SYNCTOOL                           
//TOOLMSG DD SYSOUT=*                                 
//DFSMSG  DD SYSOUT=*                                 
//IN DD DSN=TEST.XSUM.INPUT,DISP=SHR         
//OUT1 DD DSN=TEST.XSUM.OUTPUT.UNIQUE,DISP=SHR
//OUT2 DD DSN=TEST.XSUM.OUTPUT.DUPS,DISP=SHR
//TOOLIN DD *                                         
SELECT FROM(IN) TO(OUT1) ON(1,04,CH) NODUPS           
SELECT FROM(IN) TO(OUT2) ON(1,04,CH) ALLDUPS         
/*
- Eagle -
User avatar
Eagle
 
Posts: 8
Joined: Thu Nov 04, 2010 8:11 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Remove Duplicates + Original Record

Postby Alissa Margulies » Sat Nov 13, 2010 12:27 am

Eagle,

Please see the email I sent you offline.

Regards,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post