Command reference / CL
DO
Do Group
Groups CL commands within a CL program or ILE CL procedure so they are processed together as one unit. Every DO group must be closed by an ENDDO command, and DO groups can be nested. DO usually begins the THEN or ELSE part of an IF decision, but it does not have to be associated with an IF command.
Allowed environments: *BPGM, *IPGM.
Use within a CL program.
Positional parameters: 0.
Restrictions
- Valid only within a CL program or ILE CL procedure.
Parameters
No parameters.
Examples
DO
The commands between DO and ENDDO are processed once, as a group.
IF &SWITCH DO
The commands between DO and ENDDO are processed only if the logical variable &SWITCH is '1'. Otherwise control passes to the command after ENDDO.
Generated from os/cl/catalog/DO.json and os/cl/help/DO.json.