IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Subcounts in OUTFIL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthilmurugan

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Wed Dec 14, 2011 3:16 am
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Dec 14, 2011 3:43 am
Reply with quote

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
View user's profile Send private message
senthilmurugan

New User


Joined: 19 Feb 2008
Posts: 15
Location: chennai

PostPosted: Wed Dec 14, 2011 3:50 am
Reply with quote

Thx a lot Skolusu... It is working great...!

icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts How to append data from PARM in OUTFIL DFSORT/ICETOOL 17
No new posts Joinkeys overlay and unmatched with O... DFSORT/ICETOOL 11
No new posts Duplicate PARM on OUTFIL SYNCSORT 11
Search our Forums:

Back to Top