Synopsis
The variable name after a LEAVE keyword is not the name of any variable used in a loop. The variable name must match one of the variables used in some DO instruction that encompasses the LEAVE instruction. name is the name of the variable that can't be found in any DO instruction.
Cause
You specified a variable name after LEAVE, and there is no DO keyword that has that variable name as its loop counter.
Cure
Make sure that you specified the variable name correctly (ie, didn't misspell it in either the LEAVE or the DO statements).