When is a scope terminator mandatory?
-
in-line PERFORMS
-
EVALUATE
-
IF
-
all
Scope terminators (like END-PERFORM, END-EVALUATE) are mandatory for in-line PERFORMs and EVALUATE statements to clearly delimit the statement block. They are optional (not mandatory) for IF statements, though recommended for clarity. 'all' is incorrect.
In-line PERFORM statements (ones with imperative statements directly inside the PERFORM rather than a separate paragraph) require an explicit END-PERFORM scope terminator because there's no paragraph boundary to mark where the loop body ends. Likewise, EVALUATE requires END-EVALUATE to unambiguously close its WHEN branches. IF, by contrast, can be terminated either by END-IF or simply by a period, so its terminator isn't mandatory the way the other two are.