suraaj
New User
Joined: 16 Apr 2009 Posts: 69 Location: Canada
|
|
|
|
Input file key is as below:
0101011000000000000001
0101021000000000000002
0101031000000000000003
0101041000000000000004
0101051000000000000005
0101061000000000000006
0102011000000000000007
0102021000000000000008
0102031000000000000009
0102041000000000000010
0102051000000000000011
0102061000000000000012
The first six characters can repeat as many times as they want but the next 16 characters being unique.
I need to get count of records which have
0101 at third - sixth position,
0102 at third - sixth position,
0103 at third - sixth position,
0104 at third - sixth position,
0105 at third - sixth position,
0106 at third - sixth position,
0201 at third - sixth position
-----
so on till
9906 at third - sixth position
Do let me know for further details...
Please help... |
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
suraaj,
use the following DFSORT JCL
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
0101011000000000000001
0101021000000000000002
0101031000000000000003
0101041000000000000004
0101051000000000000005
0101061000000000000006
0102011000000000000007
0102021000000000000008
0102031000000000000009
0102041000000000000010
0102051000000000000011
0102061000000000000012
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC BUILD=(3,4)
SORT FIELDS=(1,4,CH,A)
OUTFIL REMOVECC,NODETAIL,BUILD=(80X),
SECTIONS=(1,4,
TRAILER3=('COUNT OF ',1,4,' AT THIRD - SIXTH POSITION IS ',
COUNT=(M10,LENGTH=8)))
//* |
|
|