COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
5. The last statement in the Declaratives Portion of a program completes execution without causing
an explicit transfer of control, and its paragraph is not the designated end of a PERFORM …
THROUGH procedure group. Following the execution of such a statement in these
circumstances, control reaches the end of the Declaratives Portion, causing execution of both
the program and the run unit to terminate abnormally.
Both the program and the run unit terminate abnormally because execution of a declarative
section is expected to be done by a PERFORM statement with these characteristics:
• An explicit PERFORM statement in the Declaratives Portion or somewhere in the rest of
the Procedure Division
• An implicit PERFORM statement executed due to either the use of the COBOL debugging
module or an input-output statement’s encountering an error
In the latter case, if the error was recoverable, control returns to the statement following the
input-output statement; if the error was not recoverable, execution of the run unit terminates.
If you transfer control directly to a procedure in a declarative section from a GO TO statement
anywhere in the Procedure Division, there is no next executable statement when execution
reaches the end of the declarative section.
Procedure Execution
A procedure is a paragraph, a group of successive paragraphs, a section, or a group of successive
sections executed as a unit. See Paragraph Execution and Section Execution.
Declaratives Portion Execution
The sections of the Declaratives Portion are executed individually when certain conditions arise
during execution of statements in the rest of the Procedure Division (see Section Execution).
Common Semantic Rules
The semantic rules about operand identification and overlapping operands apply to several
statements. Their explanations use these terms:
DefinitionTerm
A data item whose value is to be used in an operationSending data item
A data item to which the result of an operation is to be assignedReceiving 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
Intermediate data item
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
242 Procedure Division










