Define a command

To create a command, you must first define the command through command definition statements.

The general format of the command definition statements and a summary of the coding rules follow.

Statement
Coding Rules
CMD
One and only one CMD statement must be used. The CMD statement can be placed anywhere in the source file.
PARM
A maximum of 99 PARM statements is allowed. The order in which you enter the PARM statements into the source file determines the order in which the parameters are passed to the command processing program (CPP) and validity checking program (VCP). One PARM statement is required for each parameter that is to be passed to the command processing program. To specify a parameter as a key parameter, you must specify KEYPARM(*YES) for the PARM statement. The number of parameters coded with KEYPARM(*YES) should be limited to the number needed to uniquely define the object to be changed. To use key parameters, the prompt override program must be specified when creating the command. Key parameters cannot be defined with PMTCTL(*PMTRQS) or PMTCTL(label).
ELEM
A maximum of 300 ELEM statements is allowed in one list. The order in which you enter the ELEM statements into the source file determines the order of the elements in the list. The first ELEM statement must have a statement label that matches the statement label on the TYPE parameter on the PARM or ELEM statement for the list.
QUAL
A maximum of 300 qualifiers is allowed for a qualified name. The order in which you enter the QUAL statements into the source file determines the order in which the qualifiers must be specified and the order in which they are passed to the validity checking program and command processing program.
DEP
The DEP statement must be placed after all PARM statements it refers to. Therefore, the DEP statements are normally placed near the end of the source file.
PMTCTL
The PMTCTL statement must be placed after all PARM statements it refers to. Therefore, the PMTCTL statements are normally placed at the end of the source file.

At least one PARM statement must precede any ELEM or QUAL statements in the source file. The source file in which you enter the command definition statements is used by the CRTCMD command when you create a command. Use WebSphere® Development Studio (formerly known as ADTS for AS/400®) to enter statements into a source file. For information on entering statements into a source file, see the ADTS for AS/400: Source Entry Utility (SEU)Link to PDF book.