COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-8
Statements
Compiler-Directing Statement
A compiler-directing statement is a COPY, REPLACE, or USE statement. It causes the
compiler to take some specific action during compilation. A sentence that contains a
compiler-directing statement cannot contain any other statements.
The COPY statement directs the compiler to include additional source text at that point
in the program.
The REPLACE statement directs the compiler to replace source program text.
The USE statement directs the compiler to include logic in the object program that calls
the designated declarative section if the condition described in the USE statement
arises during execution.
Scope of Statements
When the formation rules for one statement cause it to contain other statements, you
must show the compiler the scope of both the contained and the containing statements
by using scope terminators. Scope terminators either explicit or implicit.
Explicit scope terminators are defined and listed under Delimited-Scope Statement.
Implicit scope terminators occur at the end of a sentence and at the end of a contained
statement.
•
At the end of any sentence, the separator period that terminates the scope of all
previous statements not yet terminated is an implicit terminator.
•
Within any statement containing another statement, the next phrase of the
containing statement following the contained statement is the implicit terminator of
the scope of any unterminated contained statement.
Note. In some implementations of COBOL, the ENTER verb marks the beginning of an
embedded routine in some other language. For this reason, ENTER is classified as a compiler-
directing verb in those implementations. The ENTER statement as implemented by
HP COBOL is similar to a CALL statement but calls a routine compiled from a language other
than COBOL.
Example 8-5. Compiler-Directing Statement
COPY NEIGHBORS-ANSWER