Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Subcounts in OUTFIL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Subcounts in OUTFIL
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    Post subject: Reply to: Subcounts in OUTFIL
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    Post subject:
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    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 OUTREC on OUTFIL error rocky_balboa DFSORT/ICETOOL 4 Thu Aug 27, 2015 10:26 am
No new posts OMIT other unsatisfied records in OUT... tvinodkumar7 DFSORT/ICETOOL 6 Thu Jan 08, 2015 1:33 pm
No new posts OUTFIL with multiple output files wit... garunmj DFSORT/ICETOOL 4 Thu Nov 06, 2014 7:08 pm
No new posts DFSORT OUTFIL, ICETOOL DISPLAY selvaganesan DFSORT/ICETOOL 2 Fri Oct 03, 2014 3:10 am
No new posts OUTREC is not working in OUTFIL ranjan jha DFSORT/ICETOOL 4 Tue Apr 29, 2014 4:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us