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-17
ADD Statements
qualifiers up to but not including the group item name specified in the ADD
CORRESPONDING statement.
group-1 and group-2
are the identifiers of group items in which some or all of the elementary items are
numeric.
The totals are placed in the group-2 items.
The following conventions apply to data items used with the CORRESPONDING
phrase:
A REDEFINES or OCCURS clause can be specified in the data description entry of
any data item.
Data items can be subordinate to a data description entry with a REDEFINES or
OCCURS clause.
No data item can be defined with a level number 66, 77, or 88.
Subordinate data items in two different groups correspond to each other according to the
following rules:
Both data items must have the same data name.
All possible qualifiers for the sending data item, up to but not including a group
name, must be identical to all possible qualifiers for the receiving data item up to but
not including the receiving group name.
Only elementary numeric data items are considered.
Any data item subordinate to a data item that is not eligible for correspondence is
ignored.
FILLER data items are ignored.
In the following example, all item names except staples and paper correspond. Those
two items are skipped in the add operations. Notice that correspondence depends on the
names of the items (and qualifiers other than the highest level ones) and not on their
physical order.
WORKING-STORAGE SECTION.
01 cabinet-supplies.
05 writing-tools.
10 pencils PIC 99.
10 pens PIC 99.
10 erasers PIC 99.
05 paper-clips PIC 99.
05 staples PIC 99.
ADD { CORR } group-1 TO group-2
{ CORRESPONDING }