COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
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 (page 243).
• 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
Correspondence depends on the names of the elementary items, not on the physical order of the
elementary items. In Example 76, all data item names correspond except STAPLES and PAPER.
Add operations skip STAPLES and PAPER.
288 Procedure Division Verbs










