CL command definition statements

Command definition statements allows system users to create additional CL commands to meet specific application needs.

These commands are similar to the system commands. The defined command calls a program to perform some function. Users can define commands by using command definition statements. The defined command can include the following:

  • Keyword notation parameters for passing data to programs
  • Default values for omitted parameters
  • Parameter validity checking so the program performing the function will have correct input
  • Prompt text for prompting interactive users

Each command on the system has a Command definition object and a command processing program (CPP).

The CPP is the program called when the command is entered. Because the system performs validity checking when the command is entered, the CPP does not always have to check the parameters passed to it.

The command definition functions can be used to:

  • Create unique commands needed by system users while keeping a consistent interface for CL command users.
  • Define alternative versions of CL commands to meet the requirements of system users. This function might include having different defaults for parameter values, or simplifying the commands so that some parameters would not need to be entered. Constant values can be defined for those parameters. The IBM-supplied commands should not be changed.
Table 1. Statements for defining CL commands
Statement type Statement name Related command Description
Command CMD Command Definition (CMD) command Specifies the prompt text for the command being created. The CMD statement can be anywhere in the source file that is referred to by the Create Command (CRTCMD) command. Only one CMD statement can be used in the source file, even if no prompt text is specified for the created command. Several create option parameters on the CRTCMD command can also be specified on the CMD statement.
Parameter PARM Parameter Definition (PARM) command Defines a parameter of a command being created. A parameter is the means by which a value is passed to the command processing program (CPP). One PARM statement must be used for each parameter that appears in the command being defined.
Element ELEM Element Definition (ELEM) command Used to define the elements of a mixed list (list elements) parameter on a command. A list parameter is a parameter that accepts multiple values that are passed together as consecutive values pointed to by a single keyword.
Qualifier QUAL Qualifier Definition (QUAL) command Describes one part of a qualified name. If a name is the allowed value of a parameter or list element defined in a PARM or ELEM statement, it can be changed to a qualified name by using a QUAL statement for each qualifier used to qualify the name.
Dependency DEP Dependent Definition (DEP) command Defines a required relationship between parameters and parameter values that must be checked. This relationship can refer to either the specific value of a parameter or parameters or to the required presence of parameters.
Prompt control PMTCTL Prompt Control Definition (PMTCTL) command Specifies a condition that is tested to determine if prompting is done for the parameters whose PARM statement refers to the PMTCTL statement.