View previous topic :: View next topic
|
Author |
Message |
sriram_motamarri Warnings : 1 New User
Joined: 14 Sep 2006 Posts: 11 Location: Chennai
|
|
|
|
Hi
I want the number of duplicates in a file using ICETOOL
Example:
Input file
Code: |
AAAAA
AAAAA
BBBBB
CCCCC
DDDDD
DDDDD
DDDDD
EEEEEE |
Output should be like
Code: |
AAAAA 0002
BBBBB 0001
CCCCC 0001
DDDDD 0003
EEEEEE 0001
|
Can you please let me know how can I get this. Thanks!! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Maybe you can have a look at this topic and amend accordingly. |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
Can you please confirm the key fields?
You last record contains 6 'E' s all others are 5?
It this a Typo? |
|
Back to top |
|
|
sriram_motamarri Warnings : 1 New User
Joined: 14 Sep 2006 Posts: 11 Location: Chennai
|
|
|
|
Sorry..its a typo...
It is only five EEEEE
Keys col 1-5 |
|
Back to top |
|
|
elango_K
New User
Joined: 18 Aug 2011 Posts: 44 Location: India
|
|
|
|
This should work: Give it a Try.
Code: |
//TOOLIN DD *
COPY FROM(IN2) TO(TEMP1) USING(CTL1)
//CTL1CNTL DD *
INREC OVERLAY=(7:C'1')
OUTFIL NODETAIL,REMOVECC,SECTIONS=(1,5,
TRAILER3=(1,5,7:TOT=(7,1,ZD,EDIT=(TTTT))))
|
|
|
Back to top |
|
|
sriram_motamarri Warnings : 1 New User
Joined: 14 Sep 2006 Posts: 11 Location: Chennai
|
|
|
|
Its working...
Thanks Elango... |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
sriram_motamarri,
The following DFSORT JCL will give you the desired results. I assumed your data is already sorted on the key. If not then change SORT FIELDS=COPY to SORT FIELDS=(1,5,CH,A)
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAAAA
AAAAA
BBBBB
CCCCC
DDDDD
DDDDD
DDDDD
EEEEE
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,5,TRAILER3=(1,5,X,COUNT=(M11,LENGTH=4)))
//* |
|
|
Back to top |
|
|
|