I have an input file where there is account number and amount field.
The account number is 1-5 and amount field is signed form 7-15 where the sign is in the 15th position.
in the input file there is same account number with different amount value.
that is one account number can be repeated more than once.
i want the sum of the amount in decimal form with sign for each account.
That means if in total there are 4 account numbers like
and the total number of records in input file is 23, after the summing i need a output file with only 4 records.
Corresponding to each account number i need the sum of the amount in signed decimal format.
the field 17-19 of input file is also there as the last field of output file.
but that field is taken from the last record of the corresponding account number.
for example-for the account number 45678 the last occurence of that account number in the input file record is as following
45678 00980000- ugf
therefore the field 17-19 of this record is written to the output file. similarly for all other account numbers, the last occurence of the corresponding account number's field 17-19 is taken to be written to the output file.