Control Language (CL) Concepts

Command definition statements

The OS/400(R) operating system lets users define a command that calls a program to perform some function. Users can define commands by using command definition statements. The defined command can include the following:

For about command definition statements, see the following:

Creating user-defined commands

Users can define a command by entering command definition statements into a source file and running a Create Command (CRTCMD) command using the source file as input. The command definition statement of each command contains one or more command statements.

One and only one CMD (command) statement must be somewhere in the source file. A PARM (Parameter) statement must be provided for each parameter that appears on the command being created. Start of change Complex parameters can be defined by using ELEM (element) statement and QUAL (Qualifier) statement to define the parts of the parameter. End of change If any special keyword relationships need checking, the DEP (dependent) statement is used to define the relationships. The DEP statement can refer only to parameters that have been previously defined. These statements can appear in any order. PMTCTL (Prompt Control) statement can be used to selectively prompt command parameters.

See the CL Programming Link to PDF book for a complete description of how to use these statements to define a command.

Only one command can be defined in each source member in the source file. The CRTCMD command is run to create the command definition object from the command definition statements in one source file member. Other users can then be authorized to use the new command by the Grant Object Authority (GRTOBJAUT) command or the Edit Object Authority (EDTOBJAUT) command.

CMD (command) statement

The Command (CMD) statement specifies the prompt text for the command being created. The CMD statement can be anywhere in the source file referred to by the Create Command (CRTCMD) command; one and only one CMD statement must be used in the source file, even if no prompt text is specified for the created command.

See the Command Definition (CMD) command for more information.

DEP (dependent) statement

The Dependent (DEP) statement 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.

See the Dependent Definition (DEP) command for more information.

ELEM (element) statement

Element (ELEM) statements are 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.

See the Element Definition (ELEM) command for more information.

PARM (Parameter) statement

The Parameter (PARM) 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 (CPP). One PARM statement must be used for each parameter that appears in the command being defined.

See the Parameter Definition (PARM) command for more information.

PMTCTL (Prompt Control) statement

The Prompt Control (PMTCTL) statement specifies a condition that is tested to determine if prompting is done for the parameters whose PARM statement refers to the PMTCTL statement.

See the Prompt Control Definition (PMTCTL) command for additional information.

QUAL (Qualifier) statement

The Qualifier (QUAL) statement 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.

See the Qualifier Definition (QUAL) command for more information.


[ Top of Page | Previous Page | Next Page | Table of Contents ]