I have this code written:
Code: Select all
05 WS-AVG-COST PIC S9(13)V99 COMP-3.
INITIALIZE WS-AVG-COST.
MOVE INB-AVG-COST TO WS-AVG-COST
COMPUTE WS-AVG-COST ROUNDED = INB-AVG-COST * 1
MOVE WS-AVG-COST TO SYU12-INPUT-FIELD
MOVE INB-AVG-COST TO SYU12-INPUT-FIELD
MOVE INI-AVG-COST TO WS-AVG-COST
COMPUTE WS-AVG-COST ROUNDED = INI-AVG-COST * 1
MOVE WS-AVG-COST TO SYU12-INPUT-FIELD
MOVE INI-AVG-COST TO SYU12-INPUT-FIELD
MOVE INI-AVG-COST TO WS-AVG-COST
COMPUTE WS-AVG-COST ROUNDED = INI-AVG-COST * 1
It's better to use MOVE instead of INITIALIZE, however for this code, it should be fine. Is there a rule to use MOVE and not INITIALIZE? What is the difference between the two?
Also he said that
Code: Select all
MOVE INB-AVG-COST TO WS-AVG-COST
Code: Select all
MOVE INI-AVG-COST TO WS-AVG-COST