View previous topic :: View next topic
|
Author |
Message |
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Hi
I have a file which has say 100 records many of which are duplicate. I want to suppress the duplicate and instead show the number of times it was repeated.
Eg:
CAT
CAT
CAT
BAT
MAT
MAT
should be displayed as
BAT 1
CAT 3
MAT 2 |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT/ICETOOL job that will do what you asked for.
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
CAT
CAT
CAT
BAT
MAT
MAT
RAT
RAT
RAT
RAT
RAT
//RPT DD SYSOUT=*
//TOOLIN DD *
OCCUR FROM(IN) LIST(RPT) NOHEADER BLANK -
ON(1,3,CH) ON(VALCNT,U04)
/*
|
RPT will have:
Code: |
BAT 1
CAT 3
MAT 2
RAT 5
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
And no extra points because the RAT didn't make the trip in the original post |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Well, a couple of extra points for the bat - another animal with undeserved bad PR. |
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Well i got to give you some point...you can take as many as you want
I got the tool working but had error with
ON(VALCNT,U04)
I removed the U04 and tried and it worked fine.
Anyway thanks a lot |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you got an error for U04, that means you're either not using DFSORT, or you're using DFSORT but you don't have the Dec, 2004 PTF installed which is needed to use the Uxx function. If it's the latter, ask your system programmer to install z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the current DFSORT function. |
|
Back to top |
|
|
antonyjoseph
New User
Joined: 11 Apr 2007 Posts: 28 Location: India
|
|
|
|
Yea,
I will see if i can get that done.
That function is to limit the number of bytes of count rite.
Anyway i guess this itself is of great help |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, the U04 gives you 4 digits for the count, overriding the default of 15 digits. It appears from your other thread that you're using Syncsort, not DFSORT, so you obviously can't apply the DFSORT PTF to get this function or any of the other DFSORT functions. |
|
Back to top |
|
|
|