Syncsort equivalent to copy first dup rec



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

Syncsort equivalent to copy first dup rec

Postby ranga_subham » Mon Jan 12, 2009 6:17 pm

Hi,

I have below job that copies every first duplicate record to o/p file.

//SORT0001 EXEC PGM=SYNCTOOL                     
//TOOLMSG  DD SYSOUT=*                           
//SSMSG    DD SYSOUT=*                           
//SORTI    DD *                                 
ABCD1                                           
ABCD2                                           
BCDE1                                           
BCDE2                                           
CDEF1                                           
CDEF2                                           
//SORTO    DD SYSOUT=*                           
//TOOLIN   DD *                                 
 SELECT FROM(SORTI) TO(SORTO) ON(1,4,CH) FIRSTDUP
/*                                               


What is the equivalent job for the above without using SYNCTOOL / ICETOOL utility?

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Syncsort equivalent to copy first dup rec

Postby ranga_subham » Mon Jan 12, 2009 6:27 pm

Ok folks !

I have achieved it this way...... :idea:

//SORT0002 EXEC PGM=SORT                     
//SYSOUT   DD SYSOUT=*                       
//SORTIN   DD *                             
ABCD1                                       
ABCD2                                       
BCDE1                                       
BCDE2                                       
CDEF1                                       
CDEF2                                       
//SORTOUT  DD SYSOUT=*                       
//SYSIN    DD *                             
 OPTION COPY                                 
 INREC OVERLAY(10:SEQNUM,3,ZD,RESTART=(1,4))
 OUTFIL INCLUDE=(10,3,ZD,EQ,001),OUTREC=(1,5)
/*                                           


Please let me know if there are any other ways possible to achieve it. :)

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Syncsort equivalent to copy first dup rec

Postby Alissa Margulies » Tue Jan 13, 2009 3:20 am

Will every record have a duplicate?
If there is a unique record, do you want that included in the output as well? If so, you can code the following:
//SYSIN DD *
  SORT FIELDS=(1,5,CH,A),EQUALS
  SUM FIELDS=NONE
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: Syncsort equivalent to copy first dup rec

Postby ranga_subham » Tue Jan 13, 2009 6:42 pm

You are right Alissa. Not every record will have duplicate.

Thank you.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Syncsort equivalent to copy first dup rec

Postby ranga_subham » Tue Jan 13, 2009 6:46 pm

Alissa, I have corrected the code as below to work it as expected !

//SYSIN DD *
  SORT FIELDS=(1,4,CH,A),EQUALS
  SUM FIELDS=NONE


Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post