Post #1
1 votes
Alex
Reputation8
Posts: 35
Joined: 06/15/2026, 09:20 AM
Posted: 08/05/2026, 09:53 AM
Can I MOVE 5 TO WS-COUNT instead of COMPUTE WS-COUNT = 5? When does COMPUTE matter?
Can I MOVE 5 TO WS-COUNT instead of COMPUTE WS-COUNT = 5? When does COMPUTE matter?
MOVE is fine for assigning values and copying fields. COMPUTE is for expressions: COMPUTE WS-TOTAL = WS-PRICE * WS-QTY.
ADD / SUBTRACT / MULTIPLY / DIVIDE also exist. I use COMPUTE when there is more than one operator.
Watch decimals. COMPUTE ROUNDED exists for a reason when you do money math.
You must be signed in to reply to this thread