I have input file with few Amount fileds in the following format 9(9).9(2)
I want to Sum fields in say columns 97 (spanned across 13 bytes 1 byte for sign, 9 for number fields, 1 byte for decima and 2 for Decimal )
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
manoz_k,
Assuming that you want to sum the amount fileds based on the key in pos 97 for 13 bytes and in pos 110 for 13 bytes the following DFSORT control cards will give you the desired results.
Assuming that you want to sum the amount fileds based on the key in pos 97 for 13 bytes and in pos 110 for 13 bytes the following DFSORT control cards will give you the desired results.
I feel i got the expected output.What i see from the Trailer record is that embeds a space before the SIGN field for that i took additional 5 bytes.Actually my file is of 81 Bytes alone, but trailer record was expecting 86, as i have 5 amount fields so 5 Signs needed.Which took it to 86.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Manoj,
SFF will handle signed and unsigned input values.
TO=ZD will handle signed and unsigned totals. The sign will be F for positive values or D for negative values. You could use TO=ZDC if you want C for positive values.