What better way to begin a study of CL programming than by looking at a typical CL procedure?
A procedure is a compilable set of CL commands. Dissecting and analyzing the various parts of a CL procedure serves as a good introduction to CL. Figure 2.1 shows a typical CL procedure. The lines that make up a CL procedure can be called CL statements or CL commands. The two terms are interchangeable.
Table 2.1. An example of typical CL procedure.
PGM PARM(&greeting) COPYRIGHT TEXT('(c) 2004, Kaiser Consulting, Inc.') DCL &greeting *CHAR 5 DCL &msg *CHAR 80 VALUE(' ') DCL &terminal *CHAR 10 DCL &user *CHAR 10 MONMSG cpf0000 begin: RTVUSRPRF *CURRENT RTNUSRPRF(&user) RTVJOBA JOB(&terminal) CHGVAR &msg ...