Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)

Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual426750-001
6-93
SUBTRACT Statements
SUBTRACT Statements
The SUBTRACT statements subtract elementary numeric data items and set the results
in specific data items. The forms of the SUBTRACT statements are:
SUBTRACT
SUBTRACT GIVING
SUBTRACT CORRESPONDING
Each form is described in the following paragraphs.
SUBTRACT Statement
The SUBTRACT statement totals all data items before keyword FROM and then
subtracts that sum from the current value of each data item after keyword FROM.
sub-1
is either a numeric literal or the identifier of an elementary numeric data item.
sub-2
is the identifier of an elementary numeric data item.
SUBTRACT GIVING Statement
The SUBTRACT GIVING statement is the same as the SUBTRACT statement, except
the result is stored in separate data items.
sub-1
is either a numeric literal or the identifier of an elementary numeric data item.
sub-2
is either a numeric literal or the identifier of an elementary numeric data item.
result
is the identifier of an elementary numeric data item.
SUBTRACT { sub-1 } ,... FROM { sub-2 } ,...
SUBTRACT { sub-1 } ,... FROM sub-2 GIVING { result } ,...