I have a transaction file like this.
History Records.
Account # Transaction date Amount
1234 20080101 1.00
1234 20080102 2.00
1234 20080130 5.00
Balance 8.00
Transaction Records
If I have transactions that come in like this
Account # Transaction date Amount
1234 20080120 (3.00)
I need to code a routine that will look at the transaction date compare it to history. If the transaction date falls between the history transaction date then I need to recalcualate the balance.
I can code this by doing a setll to the first record in the history file and then read the records until the account# changes and hold the beginning and ending date in a variable and then compare the transaction date with the range.
I was wondering if there was a better way of coding this.
Any suggestions.
Thanks,
DAC
History Records.
Account # Transaction date Amount
1234 20080101 1.00
1234 20080102 2.00
1234 20080130 5.00
Balance 8.00
Transaction Records
If I have transactions that come in like this
Account # Transaction date Amount
1234 20080120 (3.00)
I need to code a routine that will look at the transaction date compare it to history. If the transaction date falls between the history transaction date then I need to recalcualate the balance.
I can code this by doing a setll to the first record in the history file and then read the records until the account# changes and hold the beginning and ending date in a variable and then compare the transaction date with the range.
I was wondering if there was a better way of coding this.
Any suggestions.
Thanks,
DAC
Comment