COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
the order in which they appear within their paragraphs, and statements are executed in the order
in which they appear within their sentences.
Topics:
• Statement Execution
• Sentence Execution
• Paragraph Execution
• Section Execution
• Procedure Execution
• Declaratives Portion Execution
Statement Execution
An individual imperative statement is always executed in its entirety. If the statement is followed
within its sentence by another statement, control then passes to that statement; otherwise, control
passes to the next executable sentence.
A conditional statement or a delimited-scope statement is not necessarily executed in its entirety.
Instead, the truth value of the condition in the statement causes the object program to select between
alternate paths of control. Because the specific possibilities depend upon the particular statement,
they are discussed along with the individual statement descriptions.
The compiler-directing statements COPY, REPLACE, and USE do not participate in execution;
therefore, control is never transferred to or from these statements.
Sentence Execution
A sentence containing only imperative statements is always executed in its entirety. Normally,
control then passes to the next sentence in the paragraph that contains an imperative or conditional
statement. Exceptions to this rule are:
• When the last statement in the sentence is a GO TO statement, control is transferred
unconditionally to the specified paragraph or section.
• When the last statement in the sentence is a STOP RUN statement, execution of the run unit,
and thus the program, terminates.
• When the last statement in the sentence is an EXIT PROGRAM statement, control is transferred
in accordance with the rules for that statement.
If the sentence is not followed within its paragraph by any other sentence that contains an imperative,
conditional, or delimited-scope statement, and none of the preceding cases applies, then control
passes to the first executable sentence in another paragraph. The paragraph to which control
passes is determined by the rules described under Paragraph Execution.
A sentence containing a conditional or delimited-scope statement is not necessarily executed in its
entirety. After executing any initial imperative statements, the execution of the conditional or
delimited-scope statement causes the object program to select the appropriate path of control.
Control is never transferred to or from sentences that consist of a compiler-directing statement.
Paragraph Execution
Execution of a paragraph begins with the execution of the first sentence containing an imperative,
conditional, or delimited-scope statement. Except for the nested execution of other procedures or
Execution of the Procedure Division 239










