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

Sub totals using DFSORT/ICETOOL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1702
Location: Australia

PostPosted: Tue Sep 18, 2012 11:10 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top