Start of change

Showing DO and SELECT nesting levels

You can specify a CL compiler option to see the nesting level for all types of DO commands as well as SELECT commands.

Some CL source programs contain DO commands or SELECT commands where these commands are nested several levels deep. For example, between a DO command and the corresponding ENDDO command can be a DOFOR and another ENDDO command. The CL compiler supports up to 25 levels of nesting for DO commands and SELECT commands.

Changing CL source code with many levels of DO command or SELECT command nesting can be difficult. You must correctly match each type of DO command with a matching ENDDO command. You also must match each SELECT command with a matching ENDSELECT command.

The CL compiler provides an option to show the nesting levels for Do (DO), Do For (DOFOR), Do Until (DOUNTIL), Do While (DOWHILE), and Select (SELECT) commands on the CL compiler listing. Specify *DOSLTLVL for the OPTION parameter on the Create CL Program (CRTCLPGM) command, Create CL Module (CRTCLMOD) command, or Create Bound CL Program (CRTBNDCL) command to have the nesting level appear in the compiler listing. If you do not want to see this nesting level information, you can specify *NODOSLTLVL for the OPTION parameter.

End of change