COBOL Manual for TNS and TNS/R Programs

Procedure Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
8-21
Common Semantic Rules
Common Semantic Rules
The semantic rules about operand identification and overlapping operands apply to
several statements. Their explanations use these terms:
Operand Identification
An operand in a statement is either an identifier (which specifies a data item directly) or
a condition-name associated with a conditional variable (which specifies a data item
indirectly). In either case, the particular data item must be identified before the operand
can be used in executing the statement. Operand identification proceeds in this order:
1. Qualifiers
If an operand contains qualifiers, the compiler uses them to determine the correct
interpretation of the operand name.
2. Subscripts
If an operand contains subscripts, the run-time routines evaluate them from left to
right.
3. Size
If an operand has variable size, the run-time routines determine its appropriate
size. The appropriate size is usually the operand’s current actual size, but if the
operand is a receiving item, its appropriate size is sometimes its maximum size.
For details, see OCCURS Clause for Variable-Size Tables.
4. Reference Modifier
If the operand contains a reference modifier, the run-time routines evaluate the
reference modifier.
Unless the rules for a statement state otherwise, identification of each operand in a
statement occurs exactly once as the first operation (or series of operations) in the
execution of that statement. The identification of an operand only determines which
data item is specified, it does not evaluate or affect the content of the data item.
Term Definition
Sending data item A data item whose value is to be used in an operation
Receiving data item A data item to which the result of an operation is to be assigned
Intermediate data item A conceptual signed numeric data item used as a temporary
repository for the result being developed during the execution of an
arithmetic operation