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

LEAVE statement

Example

When contained in or specifying a simple do-group, the LEAVE statement terminates the group. When contained in or specifying an iterative do-group, the LEAVE statement terminates all iterations of the group, including the current iteration. The flow of control goes to the same point it would normally go to if the do-group had terminated by reaching its END statement. This point is not necessarily the statement following the END statement of the do-group (see Example).

Read syntax diagramSkip visual syntax diagram>>-LEAVE--+----------------+--;--------------------------------><
          '-label-constant-'
 
label-constant
Must be a label of a containing do-group. The do-group that is left is the do-group that has the specified label. If label-constant is omitted, the do-group that is left is the group that contains the LEAVE statement.

The LEAVE statement and the referenced or implied DO statement must not be in different blocks.

In addition to the following examples, see the example in Type 4.


Terms of use | Feedback

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