The IF statement causes a condition to be evaluated (see the topic Conditional Expressions in the chapter Procedure Division). The subsequent action of the runtime element depends on whether the value of the condition is true or false.
NEXT SENTENCE can be specified with END-IF.
If the NEXT SENTENCE phrase is executed, control does not pass to the next statement following the END-IF, but instead passes to the statement after the closest following period.
IF statements within IF statements are considered matched IF, ELSE, and
END-IF ordered combinations, proceeding from left to right. Thus, any ELSE
encountered is matched with the nearest preceding IF that has not been already
matched with an ELSE or has not been implicitly or explicitly terminated.
Any END-IF encountered is matched with the nearest preceding IF that has not
been implicitly or explicitly terminated.