Syntax
SUBTRACT one-quantity FROM second-quantity
For example,
SUBTRACT WS-VAR-2 FROM WS-VAR-1
Consider the variable WS-VAR-1 = 10, WS-VAR-2=30, subtracting WS-VAR-2 from WS-VAR-1 would result in the difference between 30 and 10. The answer is 20. This final result is stored in WS-VAR-2. SUBTRACT B FROM A is equivalent to the statement A = A – B.
The example above is shown in the code snippet below :