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).
|
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.