Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to select record x+7 or x+2 based... JoAnn Kulcyk SYNCSORT 0 Tue Jan 16, 2018 10:49 pm
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Squeeze record left so that zeroes ar... Vignesh Sid SYNCSORT 5 Fri Nov 10, 2017 1:40 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us