CL Command Reference - PARM

CL Command List > PARM Reference

Description:

The Parameter (PARM) command definition statement defines a parameter of a command being created. A parameter is the means by which a value is passed to the command processing program. One PARM statement must be used for each parameter that appears in the command being defined. The order in which the PARM statements are entered into the source file determines the order in which the parameters must be specified when the command is entered in positional form and the order in which they are passed to the validity checker and the command processing program. A maximum of 99 parameters can be defined for one command. A command with a large number of parameters will require more processing time before the command processing program is called, regardless of how many parameters are actually coded.

Note: The PARM statement contains certain parameters and predefined values that can be used only when IBM-supplied command processing programs are called by the command being defined. Because of limitations in some high-level languages, these values may not be useful in the definition statements of user-defined commands. These parameters and values are identified by the phrase (For IBM-supplied commands) that immediately follows the parameter keyword (if the entire parameter is for IBM-supplied commands only) or the predefined value to which it applies.


Examples:

Example 1: Define a Numeric Parameter

PARM KWD(X) TYPE(*DEC) LEN(2) MIN(1) REL(*GT 5)

The value for the parameter named X, a 2-digit decimal number, must be entered. The value must be greater than 5.



Example 2: Define a Parameter with Restricted Values

PARM KWD(CLASS) TYPE(*CHAR) LEN(1) DFT(A) +
VALUES(A B C) RSTD(*YES)

The value of the parameter named CLASS must be A, B, or C, if specified. If CLASS is not specified, the default value passed to the command processing program will be A.



Example 3: Define a Parameter with Range of Valid Values

PARM KWD(MAXREC) TYPE(*DEC) LEN(3 0) MIN(1) +
RANGE(&MINREC 500)

The value of the MAXREC parameter must be entered as a decimal number of 3 digits or less, with no digits to the right of the decimal point. The value must be greater than or equal to the value entered (or defaulted) for parameter MINREC and also must be less than or equal to 500.



Example 4: Define a Simple List Parameter

PARM KWD(FILES) TYPE(*NAME) MIN(2) MAX(5)

The FILES parameter is a homogeneous list that contains a minimum of two names and a maximum of five names.



Example 5: Define a List Parameter with Restricted Values

PARM KWD(INVFNAME) TYPE(*NAME) DFT(*ALL) +
SNGVAL((*ALL XXX)) VALUES(DEPT1 DEPT2 DEPT3) +
FILE(*UPD) MIN(0) MAX(3) RSTD(*YES) +
PROMPT(USR0002 1)

The value of the parameter named INVFNAME can be a list of up to three file names of which DEPT1, DEPT2, DEPT3, and *ALL are the valid choices. If *ALL is entered, no other values can be entered for the parameter. If this parameter is omitted, file name XXX is passed to the command processing program. If this parameter is entered through a command prompter, the prompt text for this parameter will be retrieved from message identifier USR0002 of the message file specified for the PMTFILE parameter on the Create Command (CRTCMD) command when the command is created. *ALL will be shown as the default parameter value.