Calculates the difference between two variables.
►►─── SUBTRACT arithmetic-expression from variable ── options ── . ───────────►◄
Expansion of options
►───┬─────────────────────────────────┬──────────────────────────────────────►◄ ├─ ROUNDED ───────────────────────┤ ├─ TRUNCATED ─────────────────────┤ └─ ALLOWING assignment-condition ─┘
Specifies the arithmetic expression being subtracted from the value contained in variable.
Specifies the data field that contains the value from which arithmetic-expression is subtracted. Following execution of the command, variable contains the result of the SUBTRACT operation.
Rounds the result of the multiplication to the number of decimal positions found in variable.
Truncates the result of the multiplication to the number of decimal positions found in variable.
The default specification is ROUNDED if COBOL moves are enabled is not selected and TRUNCATED if the option is selected.
Specifies which error conditions would normally abend and should cause control to be returned to the dialog for error handling. The list of allowable assignment-condition names can be found in the section entitled "Arithmetic and Assignment Command Status Condition."
Definition
The SUBTRACT command is used to perform subtraction. A variable data field value, a numeric literal, or the result of an arithmetic expression is subtracted from a variable data field value. The result is placed in the variable data field that contains the right operand.
Example
The following example illustrates the use of the SUBTRACT command to subtract the value in the QTY-SHIPPED field from the value in the BAL-ON-HAND field:
SUBTRACT QTY-SHIPPED FROM BAL-ON-HAND.
|
Copyright © 2014 CA.
All rights reserved.
|
|