COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-22
Overlapping Operands
Overlapping Operands
When a sending and a receiving data item in a statement overlap—that is, when they
share part or all of their storage areas but are not defined by the same data description
entry—the result of the statement is undefined. Results are also undefined for some
statements in which sending and receiving data items are defined by the same data
description entry. Such cases are noted in the descriptions of those statements.
Common Phrases
These phrases are common to several different statements:
•
CORRESPONDING Phrase
•
ROUNDED Phrase
•
SIZE ERROR Phrase
•
FROM Phrase
•
INTO Phrase
CORRESPONDING Phrase
For the purposes of this discussion, d1 and d2 are identifiers in a statement
containing a CORRESPONDING phrase and:
•
Both d1 and d2 designate group (but not level 66) data items.
•
The data description entries of d1 and d2 do not contain USAGE INDEX clauses.
•
The data description entries of one or both of d1 and d2 can include REDEFINES
or OCCURS clauses or be subordinate to items whose data description entries
include these clauses.
A pair of data items, one subordinate to d1 and one subordinate to d2, correspond if
they follow these rules:
•
Both data items have the same data-name and the same potential set of qualifiers
up to, but not including, d1 and d2. Neither data item has the data-name FILLER.
•
The data description entries of the items do not contain REDEFINES, RENAMES,
OCCURS, or USAGE INDEX clauses.
•
In a MOVE statement, at least one of the data items is an elementary data item,
and it is legal to move the sending item to the receiving item.
•
In an ADD or SUBTRACT statement, both items are elementary numeric data
items.
If a data item does not qualify as a corresponding item, then none of its subordinates
qualify either.