COBOL Manual for TNS and TNS/R Programs
Program Execution
HP COBOL Manual for TNS and TNS/R Programs—522555-006
12-25
Status of Internal Entities During Program Execution
Status of Internal Entities During Program
Execution
During the execution of a program, each internal entity retains the status in which it
was left by the execution of the last statement that affected its status:
•
Each internal data item retains the last value assigned to it. If no new value has
been assigned since the last time the program was placed in its initial state, its “last
value” is its initial value.
•
Each internal file connector retains the open-mode state and other dynamic
attributes, such as the file position indicator, set or assigned by execution of the
last statement that affects them. The record area for a file associated with an
internal file connector retains whatever contents were last assigned to it. If the file
has not been opened since the last time the program was placed in its initial state,
the file is closed (and perhaps locked), and the other dynamic attributes are
undefined. In this case, the record area contents are also undefined.
•
Each GO TO statement that was modified by execution of an ALTER statement
retains the last destination procedure specified.
•
A PERFORM statement is active if it has been executed during the current
execution of the program it is in, and the termination conditions for its control
mechanism have not yet occurred (see PERFORM); otherwise, the statement is
inactive, and its control mechanism is in the initial state.
Status of External Entities During Program
Execution
The values of external data items and the statuses of external file connectors are not
affected by the actions performed for individual programs. When a program is called,
placed in its initial state, terminated by its own execution logic, or cancelled, the status
of each external entity remains unchanged. Of course, the execution of a statement
that makes reference to an external data item or an external file connector changes its
status as the topic on that statement in Section 9, Procedure Division Verbs, describes.