Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us