COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-18
Section Execution
During the execution of a paragraph, control passes to successive sentences unless
this order is modified by a conditional or delimited-scope statement or a GO TO, STOP
RUN, CALL, ENTER, or EXIT PROGRAM statement. Execution of a paragraph that
does not have any sentences involves only the passing of control described for Item 2.
Section Execution
Execution of a section normally consists of serial execution of its paragraphs; however,
this order can be modified by explicit transfer statements (for example, a GO TO
statement) and the rules for implicit transfer of control. Execution of the section
terminates when either:
1. The execution of a GO TO, STOP RUN, or EXIT PROGRAM statement transfers
control out of the section.
2. The final paragraph of the section completes without explicitly transferring control
to some other section. In this case, control passes to the next section of the source
program, except in these situations:
•
The rules for the implicit transfer of control among procedures, described later,
can cause control to revert to some other section instead.
•
If no such reversion occurs, and the section is the last one in the source
program, the execution of the program terminates.
Execution of a section that does not have any paragraphs involves only the passing of
control described for Item 2.
Implicit Transfer of Control
The mechanism that transfers control from statement to statement in the sequence in
which they appear in the source program is an implicit transfer of control. This
mechanism applies unless it is overridden by an explicit transfer of control or the
absence of a next executable statement to which control can be passed.
Explicit Transfer of Control
An explicit transfer of control consists of execution of one of these statements:
•
Conditional
•
CALL
•
ENTER
•
Delimited-scope statement
•
EXIT PROGRAM (when executed in a called program)
•
GO TO
•
PERFORM