In determining the total of an amount field in all of the records on an input file, I need to either add or subtract the number contained in the amount field based on the value found in another field. That "flag" is either 10 (positive) or 60 (negative) (this was not my idea - the software came that way!)
I would have written it this way in COBOL:
IF FLAG = 10, ADD AMOUNT TO TOTAL_AMOUNT
ELSE SUBTRACT AMOUNT FROM TOTAL_AMOUNT.
This input file will potentially be used in many reports so I want to develop a function which can simply be called in rather than having to write the code multiple times.
Can somebody please give a CR newbie some quick help here with what probably is a very basic task? Thanks a bunch.
I would have written it this way in COBOL:
IF FLAG = 10, ADD AMOUNT TO TOTAL_AMOUNT
ELSE SUBTRACT AMOUNT FROM TOTAL_AMOUNT.
This input file will potentially be used in many reports so I want to develop a function which can simply be called in rather than having to write the code multiple times.
Can somebody please give a CR newbie some quick help here with what probably is a very basic task? Thanks a bunch.