Command reference / CL

PGM

Program

Starts a CL program or ILE CL procedure in its source file and declares the parameters it receives when called. If used, PGM must be the first command in the source; if omitted, a PGM with no parameters is assumed. Each received variable needs a matching DCL before compiling, and up to 255 can be passed. ILE does not detect mismatches between caller and callee, and a caller that passes fewer values than declared gives unpredictable results.

Allowed environments: *BPGM, *IPGM. Use within a CL program. Positional parameters: 1.

Restrictions

Parameters

PARM Parameter CL variable names

Names the CL variables that receive the values passed to the procedure, in order; each name starts with &. Up to 255 variables can be given. Null values (*N) cannot be passed for any parameter.

Type
*VARNAME
Required
No
Length
10
List limit
255
Case
Uppercase

Examples

PGM PARM(&X &Y)

Two parameters, &X and &Y, receive values from the caller.

IBM command documentation

Generated from os/cl/catalog/PGM.json and os/cl/help/PGM.json.