Hey! I’m currently a newbie to NATURAL. I think it is a great computer language. I’m working on a program and I came across a problem. This is what I’m trying to do:
If the previous payee isn is the same as the current payee isn then add the previous tranaction amount and current transaction amount. Store that amount in total isn transaction amount. Move that amount to CHK.TRAN-AMT.
Here is what I came up with:
MOVE CHK.PAYEE-ISN TO #CURR-PAYEE-ISN
MOVE CHK.TRANS-AMT TO #CURR-TRANS-AMT
COMPUTE #PREV-PAYEE-ISN = #CURR-PAYEE-ISN - 1
COMPUTE #PREV-TRANS-AMT = #CURR-TRANS-AMT - 1
IF #CURR-PAYEE-ISN = #PREV-PAYEE-ISN
ADD #PREV-TRANS-AMT #CURR-TRANS-AMT GIVING #TOTAL-ISN-TRANS-AMT
MOVE #TOTAL-ISN-TRANS-AMT TO CHK.TRANS-AMT
However, this didn’t work. When I ran my program, the #CURR-PAYEE-ISN = 4473 and #PREV-PAYEE-ISN = 4472. That is not right. #PREV-PAYEE-ISN is suppose to be the isn before #CURR-PAYEE-ISN which is 30897. Some how I nedd to read/get the isn before #CURR-PAYEE-ISN. If anyone can shed some light, I would greatly appreciate. THANK YOU IN ADVANCE!