Command reference / CL
ITERATE
Iterate
Interrupts processing of the commands in the associated DOWHILE, DOUNTIL, or DOFOR loop and passes control to the associated ENDDO. The conditional part of the DOWHILE, DOUNTIL, or DOFOR is then evaluated and processing resumes accordingly. By specifying the optional command label, processing skips to the ENDDO of the associated Do command group.
Allowed environments: *BPGM, *IPGM.
Use within a CL program.
Positional parameters: 1.
Restrictions
- This command is valid only in a CL program or ILE CL procedure.
- This command is valid only inside a DOWHILE, DOUNTIL, or DOFOR command group.
Parameters
CMDLBL
Command label
Specifies the label of the active DOWHILE, DOUNTIL, or DOFOR group to iterate. The label must be within the same program as the ITERATE command and must label an active loop. A CL variable name cannot be used.
Suggested / special values:
*CURRENT
*CURRENT- Iterates on the innermost loop surrounding this ITERATE command.
Examples
IF COND(&NAME *EQ *NONE) THEN(ITERATE)
When &NAME equals *NONE, ITERATE is processed and control passes to the ENDDO of the DOUNTIL loop, where the condition is evaluated. If &INT is 100 or less, the loop is processed again; if 101 or greater, control passes past the ENDDO.
Generated from os/cl/catalog/ITERATE.json and os/cl/help/ITERATE.json.