Scope terminators delimit the scope of certain Procedure Division statements.Statements which include their explicit scope terminators are termed delimited scope statements.
The scope of statements which are contained within other statements (nested) may also be implicitly terminated.
When statements are nested within other statements, a separator period which terminates the sentence also implicitly terminates all nested statements.
Whenever any statement is contained within another statement, the next phrase of the containing statement following the contained statement terminates the scope of any unterminated contained statement.
When a delimited scope statement is nested within another delimited scope statement with the same verb, each explicit scope terminator terminates the statement begun by the most recently preceding, and as yet unterminated, occurrence of that verb.
When statements are nested within other statements which allow optional conditional phrases, any optional conditional phrase encountered is considered to be the next phrase of the nearest preceding unterminated statement.
An unterminated statement is one which has not been previously terminated either explicitly or implicitly.
In addition to the separator period (implicit scope terminator), the following explicit scope terminators can be used to support structured programming:
END-ACCEPT |
END-DIVIDE |
END-PERFORM |
END-START |
Explicit scope terminators are reserved COBOL words.