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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to sum up the values of columns and put it in a new col
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    Post subject:
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    Post subject: Reply to: How to sum up the values of columns and put it in
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am


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