Command reference / CL
DOUNTIL
Do Until
Runs a group of CL commands one or more times, then evaluates the logical condition. While the condition is false the group is processed again; once it is true, control passes to the command after the matching ENDDO.
Allowed environments: *BPGM, *IPGM.
Use within a CL program.
Positional parameters: 1.
Restrictions
- Valid only in a CL program or ILE CL procedure.
- Up to 25 levels of nested DO, DOWHILE, DOUNTIL, and DOFOR commands are allowed.
Parameters
COND
Condition
Specifies the logical expression evaluated to decide whether the loop is processed again. Variables, constants, and the %SUBSTRING, %SWITCH, and %BINARY built-in functions can be used in it.
Examples
DOUNTIL COND(&INT *GT 100)
The group is processed until &INT is greater than 100 when ENDDO is reached. The group always runs at least once, whatever the starting value of &INT.
DOUNTIL COND('0')
The group is processed until a LEAVE or GOTO command is run, since the condition is always false.
Generated from os/cl/catalog/DOUNTIL.json and os/cl/help/DOUNTIL.json.