Page 1 of 1

Need help for Summing fields using SORT

PostPosted: Mon Dec 20, 2010 12:05 am
by sharabu07
Hi,
I have a flat file with four columns with below description

ABC -001 +002 +003
DEF +001 -002 +003
GHI -001 +002 +003

Now i want the sum of col2, col3, col4 in the output file as mentioned below

-001 002 009

also these columns in input file are in packed decimal format so before adding these i need to convert it into ZD format to make them displayable in output file.

Can anyone please help with the syntax of sort card that can be used to suffice the above requirment ?

Re: Need help for Summing fields using SORT

PostPosted: Mon Dec 20, 2010 3:02 am
by dick scherrer
Hello and welcome to the forum,

Which sort product and release are used on the system?

Re: Need help for Summing fields using SORT

PostPosted: Mon Dec 20, 2010 10:16 pm
by Frank Yaeger
What is the RECFM and LRECL of the input file?

What is the starting position and length of the key field and each PD field.