Post #1
1 votes
Alex
Reputation
8
Posts: 35
Joined: Jun 15, 2026, 9:20 AM
Posted: Aug 5, 2026, 9: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