Example: Simple CL program
This example is a CL program that calls several programs.
A CL program or procedure can be as simple or as complex as you want. To consolidate several activities normally done by the system operator at the beginning of the day (to call programs A, B, and C, for example), you can create a CL procedure called STARTUP with the following code:
PGM /* STARTUP */
CALL PGM(A)
CALL PGM(B)
CALL PGM(C)
ENDPGM
In this example, the Programmer Menu is used to create the program. You can also use the Programming Development Manager (PDM) or Remote System Explorer (RSE), which are functions of the WebSphere® Development Studio for System i licensed program.
To enter, create, and use this program or procedure, follow these steps.

To enter CL source, follow these steps:
- Select option 8 (Edit source) on the Programmer Menu and specify STARTUP in the Parm field. (This option creates a source member named STARTUP that will also be the name of the program.)
- Specify
CLLEin the Type field and press the Enter key. - On the SEU display, use the
I(insert) line command to enter the CL commands (CALL is a CL command).
Columns........: 1 71 Edit QGPL/QCLSRC
Find......: _____________________________________________ STARTUP
FMT A* .....A*. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7
************** Beginning of data ***********************************
.......
.......
.......
.......
.......
.......
When you have finished entering the source statements, complete these steps:
- Press F3 to exit from SEU.
- Accept the default on the exit display (option 2, Exit and update member) and press the Enter key to return to the Programmer Menu.
- Select option 3 (Create object) to create a program from the source statements you entered. You do not have to change any other information on the display.
When the program is created, you can call it from the Programmer Menu by selecting option 4 (Call program) and specifying STARTUP in the Parm field. If you want to run this example program, however, the referenced programs must exist by the time the CALL commands are run.