Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Count Number of Duplicate Records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Fri Apr 13, 2007 11:09 pm    Post subject: Count Number of Duplicate Records
Reply with quote

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
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Apr 13, 2007 11:24 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Apr 14, 2007 12:01 am    Post subject:
Reply with quote

And no extra points because the RAT didn't make the trip in the original post icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Apr 14, 2007 12:53 am    Post subject:
Reply with quote

Well, a couple of extra points for the bat - another animal with undeserved bad PR. icon_lol.gif
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 14, 2007 7:32 pm    Post subject: Re: Count Number of Duplicate Records
Reply with quote

Well i got to give you some point...you can take as many as you want icon_biggrin.gif

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sat Apr 14, 2007 8:53 pm    Post subject:
Reply with quote

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
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 14, 2007 11:40 pm    Post subject: Thanks
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Apr 15, 2007 8:57 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us