CL Command Reference - CRTCMD
CL Command List > CRTCMD Reference
Description:
The Create Command (CRTCMD) command creates a new user-defined command (that is, a command definition) that can use the same command processing support that is used by IBM-supplied commands. The command definition is an object that can be stored in the general purpose library (QGPL) or in a user library. To update an existing command (for example, change the name of one of its parameter keywords), the existing command must first be deleted by the Delete Command (DLTCMD) command and then created again by the Create Command (CRTCMD) command. However, some of the values can be changed by the Change Command (CHGCMD) command.
To create a command, a set of command definition statements are entered into a source file. The Create Command (CRTCMD) command is used to process the source file and create a command definition object. The following command definition statements are used as needed:
. Command statement (CMD): One CMD statement is needed for each command being defined.
. Parameter statement (PARM): One PARM statement is required for each command parameter in the command being defined. It defines the parameter to be passed to the command processing program (CPP).
. Element statement (ELEM): An ELEM statement further defines a parameter that is a list of values. One statement is required for each possible element of the list.
. Qualifier statement (QUAL): A QUAL statement is required to describe each part of a qualified name that can be accepted for a parameter (defined in a PARM statement) or for an element in a list of values (defined in an ELEM statement).
. Dependent statement (DEP): The DEP statement indicates which parameters are interdependent.
. Prompt control statement (PMTCTL): The PMTCTL statement describes the conditions used to select a parameter for prompting.
Restriction: The CRTCMD command can be used only to create the command definition of an actual CL command. That is, it cannot be used to create definitions of statements, such as the command definition statements themselves.
Examples:
CRTCMD CMD(PAYROLL) PGM(PAY076) SRCFILE(PAYSOURCE)
AUT(*EXCLUDE)
The command named PAYROLL is created from the source file PAYSOURCE. The command is private and calls the command processing program (CPP) named PAY076. It is a valid command when entered in a batch input stream, when compiled in a control language program, when entered interactively, or when passed to the QCMDEXC program.