View previous topic :: View next topic
|
Author |
Message |
revdpoel
New User
Joined: 01 Nov 2006 Posts: 56
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
revdpoel
New User
Joined: 01 Nov 2006 Posts: 56
|
|
|
|
thanks for the advice
Ron |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|