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
 

 

Reg: how to find the number of Occurrences for a record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
manikanth_e

New User


Joined: 27 Mar 2007
Posts: 13
Location: chennai

PostPosted: Fri Apr 06, 2007 2:46 am    Post subject: Reg: how to find the number of Occurrences for a record
Reply with quote

hello,
Can anyone help me out in finding the number of occurances of all the records in the input file using SORT.

Eg:
If input file contains,
aaaa
aaaa
bbbb
cccc
cccc

My output should be
aaaa 2
bbbb 1
cccc 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 06, 2007 3:11 am    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 *
aaaa
aaaa
bbbb
cccc
cccc
/*
//RPT DD SYSOUT=*
//TOOLIN   DD    *
OCCUR FROM(IN) LIST(RPT) NOHEADER -
  ON(1,4,CH) ON(VALCNT,U03)
/*
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: Fri Apr 06, 2007 3:22 am    Post subject:
Reply with quote

Hello,

This is answered in the DFSORT forum.

http://ibmmainframes.com/viewtopic.php?t=12596&highlight=key+count

You will often get answers faster if you search the forums. . .

Good luck 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: Fri Apr 06, 2007 3:55 am    Post subject:
Reply with quote

Dick,

The post you pointed to is for a more complicated situation than the one asked for here. This one can be accomplished with a simple DFSORT/ICETOOL OCCUR as shown.
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: Fri Apr 06, 2007 4:42 am    Post subject:
Reply with quote

Hi Frank,

Yup.

I remembered the previous thread and was putting that reply together while you were sending the simpler answer. When i clicked "Submit" and the refreshed screen popped up, i saw your newer answer.

Have a good one:)

d
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
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
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am


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