Hi.
I´ve these variables:
01 WS-R1 PIC 9(3)V99 VALUE ZEROS.
01 WS-R2 PIC 9(3)V99 VALUE ZEROS.
01 WS-R3 PIC 9(3)V99 VALUE ZEROS.
01 WS-R4 PIC 9(3)V99 VALUE ZEROS.
01 WS-8N99 PIC 9(3)V999 VALUE 8,99.
01 WS-99N9 PIC 9(3)V999 VALUE 99,9.
COMPUTE WS-R1 ROUNDED = WS-8N99 / WS-99N9 * 100
COMPUTE WS-R2 = WS-8N99 / WS-99N9 * 100
COMPUTE WS-R3 = WS-8N99 * 100 / WS-99N9
COMPUTE WS-R4 ROUNDED = WS-8N99 * 100 / WS-99N9
DISPLAY WS-R1 '/' WS-R2 '/' WS-R3 '/' WS-R4
Results:
00890/00890/00899/00900
Why WS-R2 and WS-R3 are diferent? And WS-R1 & WS-R4 are different ?
The correct result is WS-R3 and WS-R4
WS-R1 & WS-R2 are wrong, try using a calculator.
Can anyone explain me way these results in WS-R1 AND WS-R2 ?
Thanks