COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-15
ADD CORRESPONDING
group-2
is the identifier of a data structure in which some or all of the elementary items are
numeric. The value of each elementary numeric item in group-2 that
corresponds to an elementary numeric item in group-1 is replaced by the sum
of the two corresponding items, as in the ADD TO statement.
ROUNDED
specifies that result is to be rounded before being stored.
imperative-stmt-1
is an imperative statement to be executed if a size error occurs during the addition
of addends or the storing of a result.
imperative-stmt-2
is an imperative statement to be executed if no size error occurs during the
addition of addends or the storing of a result.
END-ADD
ends the scope of the ADD statement and makes it a delimited-scope statement. If
you omit END-ADD but include the SIZE ERROR or NOT SIZE ERROR phrase,
the ADD statement is a conditional statement and ends at the next period
separator.
Usage Considerations:
•
Definition of Correspondence
See CORRESPONDING Phrase.
•
ADD CORRESPONDING Statement Generates ADD TO Statements
Each pair of corresponding elementary data items, group-1-item and
group-2-item, generates an ADD TO statement equivalent to this:
ADD group-1-item TO group-2-item [ROUNDED]
•
Problem Adding Names to Group Data Items
When adding names to group data items that appear in ADD CORRESPONDING
statements, verify that the new name will not be included in unintended addition
operations.
•
See these usage considerations in ADD TO:
°
Operand Identification Order
°
Arithmetic Operations
°
Precision
°
ROUNDED, SIZE ERROR, and NOT SIZE ERROR Phrases