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
 
Count the amount of records for everycode

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

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Thu Feb 12, 2009 5:58 pm    Post subject: Count the amount of records for everycode
Reply with quote

I have a file of 8 million records

record looks like this

1453006799

45 on postion 2-3 is a code
The file conists of hundreds of duplicate codes
I have to count the amount of records for everycode

if this is input

1453006799
1453006799
1213006799
1183006799
1183006799

then this must be output

18 0002
21 0001
45 0002


Thanx
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Feb 12, 2009 6:21 pm    Post subject:
Reply with quote

This DFSORT/ICETOOL job works for me
Code:

//*                                                             
//ICETOOL1 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//INFILE   DD DSN=What-ever,DISP=SHR
//OUFILE   DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
 OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(2,2,CH) ON(VALCNT)
/*                                                               

Give the result
Code:

18                     000000000000002
21                     000000000000001
45                     000000000000002
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Thu Feb 12, 2009 8:05 pm    Post subject:
Reply with quote

thanks for the advice

Ron
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: Thu Feb 12, 2009 10:27 pm    Post subject:
Reply with quote

Note that you can tailor the output to look exactly as you requested by changing the OCCURS operator to:

Code:

 OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER BETWEEN(1) - 
   ON(2,2,CH) ON(VALCNT,E'9999')                 
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 write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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