RATE THIS ANSWER
+1
Click to Vote:
1
0
I assume you recompiled the CMD. and have specified the correct parms for PGM and SRCFILE/SRCMBR
*
Here is a sample of one of mine
*
QCMDSRC
/* COMMAND TO SET LIBRARY LIST FOR A JOB */
FL: CMD PROMPT('Set Library List')
/* PARAMETERS... */
PARM KWD(LIBLKEY) TYPE(*CHAR) LEN(10) +
PROMPT('Library List Key')
**
QCLSRC
PGM PARM(&pENV)
/*-------------------------------------------------------------------*/
/* Define the variables */
/*-------------------------------------------------------------------*/
DCL VAR(&pENV ) TYPE(*CHAR) LEN(10)
DCL VAR(&pCURLIB) TYPE(*CHAR) LEN(10)
DCL VAR(&pLIST30) TYPE(*CHAR) LEN(330)
DCL VAR(&wParm ) TYPE(*CHAR) LEN(512)
/*-------------------------------------------------------------------*/
/* Ensure required libraries are in the *LIBL */
/*-------------------------------------------------------------------*/
Addlible PRODPGM
MonMsg CPF0000
Addlible ShareData
MonMsg CPF0000
/*-------------------------------------------------------------------*/
/* Get Library values for the requested Enviornment */
/*-------------------------------------------------------------------*/
CALL PGM(GETLIBLR) PARM(&pEnv &pCURLIB &pLIST30)
/*-------------------------------------------------------------------*/
/* Set Current Library */
/*-------------------------------------------------------------------*/
IF COND(&pCURLIB = ' ') THEN(CHGVAR +
VAR(&pCURLIB) VALUE('*CRTDFT'))
CHGCURLIB CURLIB(&pCURLIB)
/*-------------------------------------------------------------------*/
/* Set the Library List. */
/*-------------------------------------------------------------------*/
CHGVAR VAR(&WPARM) VALUE('CHGLIBL (' || &PLIST30 || +
')')
CALL PGM(QCMDEXC) PARM(&wPARM 512)
END: ENDPGM
============================================================
In order to require entry of a command parameter value, the PARM must include a MIN() attribute value greater than zero. For example:
PARM KWD(JOB) +
TYPE(*NAME) +
LEN(10) +
SPCVAL( +
(*JOBD )) +
MIN(1) +
EXPR(*YES) +
PROMPT('Job name' 1)
The ADDJOBSCDE command uses the above definition for its JOB() parameter. If you simply type ADDJOBSCDE on a command line and press [Enter], the command definition prompts the user to enter values for JOB(), CMD() and FRQ() as a minimum requirement. The MIN(1) attribute says that a
minimum of one value must be entered for JOB(). Since parameters may be lists of values, it's possible to require more than one value as a minimum. All three parameters for ADDJOBSCDE have the MIN(1) attribute.
A potential alternative is to leave the MIN(0) default in place, but also add a DFT() attribute. Supply a default value right in the command. If users don't put a value in, then your default will be used anyway.
Adding default values rather than requiring entry of values is especially useful if the command has been coded into CL programs. The default allows you not to have to track down every program to add the parameter into the CL.
Tom
Last Answered:
Oct 15 2009 8:42 PM GMT by TomLiotta 
8025 pts.