View previous topic :: View next topic
|
Author |
Message |
senthilmurugan
New User
Joined: 19 Feb 2008 Posts: 15 Location: chennai
|
|
|
|
Hi,
I have below input format...
Code: |
|C|011|005|999999991|2|
|C|011|005|999999992|8|
|D|011|006|999999993|2|
|D|011|006|999999994|8|
|C|022|006|999999995|2|
|C|022|006|999999996|8|
|E|033|006|999999997|2|
|E|033|006|999999997|3|
|E|033|006|999999998|8|
|C|052|006|999999990|2|
|
Can i get the output like this...
Code: |
ID: C - Num 2 count : 3
ID: C - Num 8 count : 2
ID: C - Total count : 5
ID: D - Num 2 count : 1
ID: D - Num 8 count : 1
ID: D - Total count : 2
ID: E - Num 2 count : 1
ID: E - Num 3 count : 1
ID: E - Num 8 count : 1
ID: E - Total count : 3
Total records: 10
|
ID - Position is (2,1)
Number position is (22,1)
FB/80
I have tried the below SORT.. But i could not get the subcounts for numbers 2,3,8.... I got only ID count and total count..
Code: |
OUTFIL NODETAIL,
TRAILER1=(/,1:'TOTAL : ',25:COUNT),
SECTIONS=(3,1,TRAILER3=(1:'COUNT ON ID ',3,1,C':',25:COUNT))
|
Please guide me to proceed further... |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
senthilmurugan,
Use the following DFSORT JCL which will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
|C|011|005|999999991|2|
|C|011|005|999999992|8|
|D|011|006|999999993|2|
|D|011|006|999999994|8|
|C|022|006|999999995|2|
|C|022|006|999999996|8|
|E|033|006|999999997|2|
|E|033|006|999999997|3|
|E|033|006|999999998|8|
|C|052|006|999999990|2|
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INREC BUILD=(2,1,22,1,C'00000001')
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=(3,8,ZD)
OUTFIL REMOVECC,
BUILD=(3:C'ID: ',1,1,C' - NUM ',2,1,
C' COUNT : ',3,8,ZD,M10,LENGTH=8,80:X),
SECTIONS=(1,1,TRAILER3=('ID: ',1,1,' - TOTAL COUNT : ',
TOT=(3,8,UFF,M10,LENGTH=8),/)),
TRAILER1=('TOTAL RECORDS : ',TOT=(3,8,UFF,M10,LENGTH=8))
//* |
The output is
Code: |
ID: C - NUM 2 COUNT : 3
ID: C - NUM 8 COUNT : 2
ID: C - TOTAL COUNT : 5
ID: D - NUM 2 COUNT : 1
ID: D - NUM 8 COUNT : 1
ID: D - TOTAL COUNT : 2
ID: E - NUM 2 COUNT : 1
ID: E - NUM 3 COUNT : 1
ID: E - NUM 8 COUNT : 1
ID: E - TOTAL COUNT : 3
TOTAL RECORDS : 10
|
|
|
Back to top |
|
|
senthilmurugan
New User
Joined: 19 Feb 2008 Posts: 15 Location: chennai
|
|
|
|
Thx a lot Skolusu... It is working great...!
|
|
Back to top |
|
|
|
|