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

How to sum up the values of columns and put it in a new col


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Thu Jul 30, 2009 12:15 pm
Reply with quote

Input file structure
FLD1 FLD2 FLD3 AMT1 AMT2 AMT3

Required output file
FLD1 FLD2 FLD3 AMT1 AMT2 AMT3 SUM

Where SUM = AMT1+AMT2+AMT3

Is this possible in SYNCSORT?

I cannot use DFSORT or ICETOOL as of now.

Let me know if there is any option.

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

New User


Joined: 13 Dec 2008
Posts: 53
Location: New York

PostPosted: Thu Jul 30, 2009 4:05 pm
Reply with quote

Hi,

The below sort will gives you the desired output.

Input:
Code:
----+----1----+----2----+----3---
FLD1 FLD2 FLD3 AMT1 AMT2 AMT3 SUM


Code:
OPTION COPY                                       
OUTREC OVERLAY=(31:(16,4,ZD,ADD,21,4,ZD,ADD,26,4),EDIT=(TTTT))
Back to top
View user's profile Send private message
VinayCM

New User


Joined: 06 Nov 2007
Posts: 36
Location: Bengaluru

PostPosted: Thu Jul 30, 2009 4:46 pm
Reply with quote

Thanks a bunch Bhargav. It worked, otherwise i was planning to use EZTRIEVE for doing this process. Thanks again.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Remote Unload of CLOB Columns DB2 6
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
Search our Forums:

Back to Top