I have a requirement here where in I am supposed to add the columns in the same record and the resultant total should be inserted as a new column in the output file (including the columns in the input file).
The input with FB is shown below, please note that the fields are numeric with a single decimal point,
You were attempting Packed Decimal (PD) processing of your data. You really have Zoned Decimal plus a sign and a decimal place.
Although capable of more than you need, you'll find the Free Format (FF) data types will do what you want. You have Signed Free Format, which is SFF.
If you do a search for SFF in the manual and find the table it is in you'll see good descriptions of all the data types. Read through them all, so you know what is there, then concentrate on the PDs, ZDs and FFs.
which sums up to 198461528.1. However, my output file using the above sort card shows the value 198461518 only without any decimal. Is there any way through which I can re-format my output file which will show up the result including decimals.
Bill, I have fixed the above and I am now getting the desired output. Actually in the sort card I was supposed to extract 21 digits, while I was doing it for only 20, as above. I have rectified it and it is working now with proper SUM values. Thanks for your support.