The END statement ends one or more blocks or groups. Every block or group must have an 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.