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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm


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