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 particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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