So i try to display a decimal number from some variable , lets say i have pic 9(13)v99 and i have a variable ws-amount with value 000000804793807 -> i expect the value when i display is 000000804793807(just ignore the '.' for separated decimal) But the reality is the spool display 000000804793800 . (i dont know how can the 07 turns into 00) ..
this is the code
Working storage section
01 WS-AMOUNT-15.
05 WS-AMOUNT-13 PIC 9(13).
05 WS-DECIMAL-2 PIC V9(02).
01 WS-VALUE PIC 9(15).
PROCEDURE SECTION
MOVE 000000804793807 TO WS-VALUE
MOVE WS-VALUE(1:13) TO WS-AMOUNT-13.
MOVE WS-VALUE(14:2) TO WS-DECIMAL-2.
MOVE WS-AMOUNT-15 TO DA-PST-AMOUNT.
//*TRY TO DISPLAY THE VALUE.
DISPLAY 'AMT(1:13): ' WS-VALUE(1:13).
DISPLAY 'AMT(14:2): ' WS-VALUE(14:2).
DISPLAY 'WS-AMOUNT-13: ' WS-AMOUNT-13.
DISPLAY 'WS-DECIMAL-2: ' WS-DECIMAL-2.
DISPLAY 'WS-AMOUNT-15: ' WS-AMOUNT-15.
Result
AMT(1:13): 0000008047938
AMT(14:2): 07
WS-AMOUNT-13: 0000008047938
WS-DECIMAL-2: 00
WS-AMOUNT-15: 000000804793800
is there anything wrong with my structure? i want the decimal of 07 remain in the ws-amount-15 , not 00 ..