IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Fri Apr 06, 2007 3:11 am
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

Moderator Emeritus


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

PostPosted: Fri Apr 06, 2007 3:22 am
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 Developer


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

PostPosted: Fri Apr 06, 2007 3:55 am
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

Moderator Emeritus


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

PostPosted: Fri Apr 06, 2007 4:42 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
Search our Forums:

Back to Top