MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sum fields

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
govardhan
Beginner


Joined: 14 Jun 2005
Posts: 1
Topics: 1

PostPosted: Tue Aug 16, 2005 12:24 pm    Post subject: Sum fields Reply with quote

Hi,

Can I add 2 field values which are in different positions in a file using SORT utility.

For eg:
COnsider the following COBOL declaration

Input File
01 TEST-IN.
05 NUMBER PIC X(6).
05 FULL-TIME-AMT PIC S9(7)V2 COMP-3.
05 PART-TIME-AMT PIC S9(7)V2 COMP-3.

Output File.
01 TEST-OUT.
05 NUMBER PIC X(6).
05 TOTAL-AMT PIC S9(7)V2 COMP-3.

So, I want to add FULL-TIME-AMT and PART-TIME-AMT and get the output in to the field TOTAL-AMT, by using SORT utility.

Thanks in advance
Govardhan
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Aug 16, 2005 1:00 pm    Post subject: Reply with quote

You can use DFSORT's arithmeric operations to do this as follows:

Code:

   OPTION COPY
   OUTREC FIELDS=(1,6,7:7,5,PD,ADD,12,5,PD,TO=PD,LENGTH=5)

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group