LEAVE is valid only within a repetitive DO loop

Synopsis
A LEAVE keyword is not where it should be. This keyword should appear only within a loop, and may not appear outside of a loop.

Cause
You specified a LEAVE outside of a loop.

Cure
Make sure there is at least one DO keyword before the LEAVE (and an END keyword after).