sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2147 Location: USA
|
|
|
|
Code: |
//*================================================
//* COUNT DUPLICATES
//*================================================
//COUNTDUP EXEC PGM=SORT
//*
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD *
AAAAA
BBBBB
CCCCC
EEEEE
DDDDD
CCCCC
EEEEE
BBBBB
BBBBB
CCCCC
BBBBB
CCCCC
CCCCC
AAAAA
AAAAA
//*
//SORTOUT DD SYSOUT=*
//*
//SYSIN DD *
*
SORT FIELDS=(1,30,CH,A)
*
OUTFIL FNAMES=(SORTOUT),
NODETAIL,REMOVECC,
SECTIONS=(1,30,
TRAILER3=(1,30,
C' REPEATED ',
COUNT=(ZD,LENGTH=3),
C' TIMES'))
*
END
//*
//*======================================== |
Code: |
********************************* TOP OF DATA ********
AAAAA REPEATED 003 TIMES
BBBBB REPEATED 004 TIMES
CCCCC REPEATED 005 TIMES
DDDDD REPEATED 001 TIMES
EEEEE REPEATED 002 TIMES
******************************** BOTTOM OF DATA ****** |
The same approach also works for DFSORT, mysteriously moved to separate partition of the forum.
Mod: *** Syncsort ONLY solutions will be moved to the relevant forum, in this case it did not appear the 'solution' was complete either.*** |
|