Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

END statement

The END statement ends one or more blocks or groups. Every block or group must have an END statement.

Read syntax diagramSkip visual syntax diagram>>-END--+-----------------+--;---------------------------------><
        '-statement-label-'
 
statement-label
Cannot be subscripted. If a statement-label follows END, the END statement closes the unclosed group or block headed by the nearest preceding DO, SELECT, PACKAGE, BEGIN, or PROCEDURE statement having that statement-label. Every block with a DO, SELECT, PACKAGE, BEGIN or PROCEDURE statement must have a corresponding END statement.

If a statement-label does not follow END, the END statement closes the one group or block headed by the nearest preceding DO, SELECT, PACKAGE, BEGIN, or PROCEDURE statement for which there is no other corresponding END statement.

Execution of a block terminates when control reaches the END statement for the block. However, it is not the only means of terminating a block's execution, even though each block must have an END statement. (See Procedures and Begin-blocks for more details.)

If control reaches an END statement for a procedure, it is treated as a RETURN statement.

Normal termination of a program occurs when control reaches the END statement of the main procedure.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)