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
 
SUM FIELDS=

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

New User


Joined: 10 Jun 2005
Posts: 62

PostPosted: Tue Jun 14, 2005 5:00 pm    Post subject: SUM FIELDS=
Reply with quote

Pls anyone suggest me how to achieve below

Below is FILEA records

Code:

A      B      C
017 04000 050000
017 03000 030000
017 07000 020000
810 01000 020000
810 02000 010000
900 01000 020000


I want the output as below

Code:

017 14000 100000
810 03000 030000
900 01000 020000


Thanks..
Back to top
View user's profile Send private message

Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Tue Jun 14, 2005 6:08 pm    Post subject: Re: SUM FIELDS=
Reply with quote

sangiah,

Here is the JCL that do what you need
Code:

//STEP0001 EXEC PGM=ICETOOL                     
//DFSMSG   DD SYSOUT=*                         
//TOOLMSG  DD SYSOUT=*                         
//TOOLIN   DD *                                 
  SORT FROM(IN) TO(OUTX) USING(ICE0)           
/*                                             
//IN       DD *                                 
017 04000 050000                               
017 03000 030000                               
017 07000 020000                               
810 01000 020000                               
810 02000 010000                               
900 01000 020000                               
/*                                             
//OUTX     DD SYSOUT=*                         
//ICE0CNTL DD *                                 
  OPTION ZDPRINT                               
  SORT   FIELDS=(1,3,ZD,A)                     
  SUM    FIELDS=(5,5,ZD,11,6,ZD)

The output is:
Code:

017 14000 100000
810 03000 030000
900 01000 020000

Alain
Back to top
View user's profile Send private message
sangiah

New User


Joined: 10 Jun 2005
Posts: 62

PostPosted: Tue Jun 14, 2005 8:17 pm    Post subject: Re: SUM FIELDS=
Reply with quote

thanks alain.. this is what exactly i am looking for..
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 SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm

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