COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-268
SUBTRACT CORRESPONDING
group-1
is the identifier of a data structure in which some or all of the elementary items are
numeric.
group-2
is the identifier of a data structure that has one or more elementary numeric items.
For each elementary numeric item in group-2 that corresponds to such an item
in group-1, the difference between the values of the two items replaces the value
of group-2.
The composite picture of any pair of items aligned by decimal points must not
involve more than 18 digits of representation.
ROUNDED
specifies that each difference be rounded before being stored.
imperative-stmt-1
is an imperative statement for the compiler to execute when it detects a size error
in any subtraction or in storing the result.
imperative-stmt-2
is an imperative statement to be executed when no size error is detected in any
subtraction or in storing the result.
END-SUBTRACT
ends the scope of the SUBTRACT statement, causing the SUBTRACT to be a
delimited-scope statement. If the SUBTRACT statement does not end with an
END-SUBTRACT phrase, the presence of the SIZE ERROR or the NOT SIZE
ERROR phrase causes the SUBTRACT statement to be a conditional statement,
which ends at the next period separator.
Usage Considerations:
Definition of Correspondence
Groups of data correspond if they have the same names and qualifier names,
beyond the group-names in the SUBTRACT statement, and if they meet restraints
explained under CORRESPONDING Phrase.
Problem Inherent in Using SUBTRACT CORRESPONDING
The SUBTRACT CORRESPONDING statement can save keystrokes, but can
cause problems when someone adds a name to a data structure: the name might
be included in an unintended subtraction operation.