Example: Simple CL procedure

This example is a procedure that calls several programs.

A CL program 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 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 could also use the programming development manager (PDM), which is part of the WebSphere® Development Studio.

To enter, create, and use this program, follow these steps:


In this example, the Programmer Menu is used to create the program. You could also use the programming development manager (PDM), which is part of the WebSphere Deveopment Stuido. To enter, create, and use this program, follow these steps

To enter CL source:

 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:

Note: The referenced programs (A, B, and C) do not have to exist when the program STARTUP is created.

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 attempt to run this sample program, however, the referenced programs must exist by the time the CALL commands are run.

Related information
Call (CALL) command