COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

DONE-WITH-MASTER was false, you would have to package the READ statement in a separate
paragraph. Then you could end the AT END phrase with a period that did not also end the IF
statement.
Example 59 Conditional Statement
IF NOT DONE-WITH-MASTER
READ MASTER-FILE
AT END MOVE DONE-VALUE TO MASTER-FLAG.
Compare Example 59 to Example 60.
Delimited-Scope Statement
A delimited-scope statement is any statement that terminates in its explicit scope terminator. An
explicit scope terminator is a reserved word used to delimit the scope of a conditional statement
or in-line PERFORM statement.
Table 41 Explicit Scope Terminators
END-SUBTRACTEND-RETURNEND-EVALUATEEND-ADD
END-UNSTRINGEND-REWRITEEND-IFEND-CALL
END-WRITEEND-SEARCHEND-MULTIPLYEND-COMPUTE
END-UNSTRINGEND-STARTEND-PERFORMEND-DELETE
END-STRINGEND-READEND-DIVIDE
The form of each explicit scope terminator includes the verb from the statement that it terminates.
Explicit scope terminators can appear only as specified in the general formats for statements. When
the appropriate explicit scope terminator follows a conditional statement, it is considered to be a
delimited-scope statement instead.
In Example 60, if there were no END-READ scope terminator, the PERFORM would be part of the
AT END phrase of the (conditional) READ statement.
Example 60 Delimited-Scope Statement
IF NOT DONE-WITH-MASTER
READ MASTER-FILE
AT END MOVE DONE-VALUE TO MASTER-FLAG
END-READ
PERFORM PROCESS-MASTER-RECORD
UNTIL DONE-WITH-MASTER
END-IF
Under the rules for statement execution, a delimited-scope statement is handled in the same manner
as a conditional statement. This is because it can include phrases that are or are not executed
depending upon the value of a condition (for example, the delimited-scope IF statement) or upon
the occurrence of an exception (for example, the delimited-scope READ statement).
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.
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.
232 Procedure Division