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
 

 

Sub totals using DFSORT/ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Ragav86

New User


Joined: 27 Jan 2010
Posts: 37
Location: chennai

PostPosted: Tue Sep 18, 2012 9:40 am    Post subject: Sub totals using DFSORT/ICETOOL
Reply with quote

Hi,

Can anyone help with the below requirement.
I got a requirement to create subtotal report for the input file.

Input file contains below records


Code:

1111,001,10
1111,002,10
1111,003,10
1111,004,10
1111,005,10
1111,006,10
2222,001,10
2222,002,10
2222,003,10
2222,004,10
2222,005,10
2222,006,10
2222,007,10
3333,001,10
3333,002,10
3333,003,10
3333,004,10


Output file should be like this
Code:

1111,001,10
1111,002,10
1111,003,10
1111,004,10
1111,005,10
1111,006,10
1111,000,60
2222,001,10
2222,002,10
2222,003,10
2222,004,10
2222,005,10
2222,006,10
2222,007,10
2222,000,70
3333,001,10
3333,002,10
3333,003,10
3333,004,10
3333,000,40


subtotals should be generated with XXXX,000,subtotal
the sysin statements should not be depends on input data it should be generic.
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Sep 18, 2012 11:10 am    Post subject:
Reply with quote

Hi,

try this
Code:
//STEP0001 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD *                                 
1111,001,10                                     
1111,002,10                                     
1111,003,10                                     
1111,004,10                                     
1111,005,10                                     
1111,006,10                                     
2222,001,10                                     
2222,002,10                                     
2222,003,10                                     
2222,004,10                                     
2222,005,10                                     
2222,006,10                                     
2222,007,10                                     
3333,001,10                                     
3333,002,10                                     
3333,003,10                                     
3333,004,10                                     
//COUNTS   DD SYSOUT=*                                               
//SYSIN    DD *                                                       
  SORT FIELDS=COPY                                                   
  OUTFIL FNAMES=COUNTS,REMOVECC,                                     
               SECTIONS=(1,4,                                         
  TRAILER3=(1,5,C'000,',                                             
            TOT=(10,2,ZD,EDIT=(TTT))))                               
/*                                                                   



Gerry
Back to top
View user's profile Send private message
Ragav86

New User


Joined: 27 Jan 2010
Posts: 37
Location: chennai

PostPosted: Tue Sep 18, 2012 5:21 pm    Post subject:
Reply with quote

thanks its working as expected
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Getting sum on Totals and Adjusted to... balaji81_k DB2 6 Fri Mar 24, 2017 7:51 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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