We have a situation where we divide the annual interest rate by 12, to calculate the monthly payment.
01 FIN-AMT PIC S9(15)V9(2) COMP-3 VALUE 125000.00.
01 NUM-MNTS PIC S9(04) COMP VALUE 24.
01 FREQ1 PIC S9(04) COMP VALUE 12.
01 ANNL-RATE PIC S9(1)V9(6) COMP-3 VALUE 0.0599.
01 WS-TEMP-AMOUNT PIC S9(08)V9(10) COMP-3.
I cannot provide the exact formulae, however I can mimic the same to explain the context.
We want to know what will be the intermediate value for this division - ANNL-RATE/12. We are suspecting some kind of truncation which is not providing us an expected result.
0.00499167 is the expectation, however we suspect we get some value around 0.00491....because of which we are losing some $10 amount in the WS-TEMP-AMOUNT
PIC clause for the intermediate value is unaware for us, to determine the issue reason. Please help us here.
COMPUTE WS-TEMP-AMOUNT = (FIN-AMT * NUM-NMTS * (ANNL-RATE/12) ) / FIN-AMT * (1+ANNL-RATE/12)