View previous topic :: View next topic
|
Author |
Message |
manikanth_e
New User
Joined: 27 Mar 2007 Posts: 13 Location: chennai
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|