counting duplicate records per control field



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

counting duplicate records per control field

Postby Sarah88 » Wed Jul 21, 2010 8:02 am

I'm trying to create a report by sorting a VB file and removing duplicates. However, the report should include the number of duplicates per control field. Can anyone advise? Is it possible to use SEQNUM to keep a counter per unique key?

i.e.
SORT FIELDS=(1,5,CH,A)
SUM FIELDS=NONE

Input Dataset
AAAAA
BBBBB
BBBBB
CCCCC
CCCCC
CCCCC
DDDDD
DDDDD
DDDDD
DDDDD
...

Output Dataset
AAAAA 001
BBBBB 002
CCCCC 003
DDDDD 04

Would the solution change if there were multiple fields in the SORT stmt?
Sarah88
 
Posts: 1
Joined: Wed Jul 21, 2010 7:41 am
Has thanked: 0 time
Been thanked: 0 time

Re: counting duplicate records per control field

Postby dick scherrer » Wed Jul 21, 2010 9:08 am

Hello and welcome to the forum,

Untested, but please try this:
//STEP0001 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
your data                                               
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  OUTFIL REMOVECC,NODETAIL,                                             
    SECTIONS=(1,5,                                                     
       TRAILER3=(1,5,COUNT=(M10,LENGTH=3)))         
/*   
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post