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

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.

Type
*CHAR
Required
Yes
Length
50
Case
Uppercase

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.

IBM command documentation

Generated from os/cl/catalog/DOUNTIL.json and os/cl/help/DOUNTIL.json.