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

Sum two columns in a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Thu Jun 10, 2010 12:09 pm
Reply with quote

Hi,
Is it possible in sort to do a horizontal sum. I need to add two columns in a same record. Example
Input
Code:

----+----1----+----2
RECORD1 00050 00060
RECORD2 00010 00050
RECORD3 00020 00040
RECORD4 00090 00000

Required Output
Code:

----+----1----+----2-
RECORD1 00110 00000 
RECORD2 00060 00000 
RECORD3 00060 00000 
RECORD4 00090 00000 
Back to top
View user's profile Send private message
anshul_gugnani

New User


Joined: 02 Nov 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Jun 10, 2010 1:40 pm
Reply with quote

Hi,

Yes, its is possible to ADD TWO COLUMNS OF A RECORD. Dont know wat is "horizontal sum".

Assuming
1st field - 01 to 07
2nd field - 08 to 12
3rd field - 13 to 17

Below sort card will give you desired result -
Code:
SORT FIELDS=COPY                                               
OUTREC FIELDS=(01:01,07,08:08,05,ZD,ADD,13,05,ZD,M11,LENGTH=05,
          13:C'00000')                                         


Thanks.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top