On 05 Apr 2013 08:42, Mr. K.V.B.L. wrote:
> <<SNIP>> another problem. I have other parameters that are blank
> that I want answers to (PATH, PORT, NUMCHLD), but supplying a
> default value for my first two parameters seems to remove any
> requirement for them.
>
> I think what I want is for my Cmd to always prompt the screen with
> the values. If I simply hit enter after my cmd, I get a "CPF0001
> received by STARTQQENG at 4000. (C D I R)" (my CL pgm handling the
> CMD) because it is receiving empty values.
>
> CMD PROMPT('Start DFC Engine')
> PARM KWD(PGM) TYPE(QPGM) PROMPT('Engine Program Name')
> QPGM: +
> QUAL TYPE(*NAME) LEN(10) DFT(TRAN_ENGV2)
> QUAL TYPE(*NAME) LEN(10) DFT(*CURLIB) SPCVAL((*CURLIB *CURLIB)) MIN(0) PROMPT('Library')
> PARM KWD(PATH) TYPE(*PNAME) LEN(1000) MIN(1) CASE(*MIXED) PROMPT('Home IFS Directory')
> PARM KWD(PORT) TYPE(*UINT4) MIN(1) PROMPT('Listening Port')
> PARM KWD(NUMCHLD) TYPE(*UINT4) MIN(1) PROMPT('Number Of Children To Start')
> PARM KWD(JOBNAME) TYPE(*NAME) LEN(10) DFT(DFCENG) PROMPT('Name Of This Job')
> PARM KWD(JOBD) TYPE(QUAL_JOBD) MIN(1) PROMPT('Job Description')
> QUAL_JOBD: +
> QUAL TYPE(*GENERIC) DFT(*ALL) SPCVAL((*ALL))
> QUAL TYPE(*NAME) DFT(*ALLUSR) SPCVAL((*ALL) (*ALLUSR) (*CURLIB) (*LIBL) (*USRLIBL)) +
> PROMPT('Library')
> PARM KWD(USER) TYPE(*NAME) LEN(10) DFT(DFCUSER) PROMPT('Username To Run Under')
> PARM KWD(DEBUG) TYPE(*CHAR) LEN(4) RSTD(*YES) DFT(*NO) VALUES(*YES *NO) PROMPT('Debug On?')
Just as the listing in the prior iteration of the compiled command
definition object gave the answer as to the origin of the problem being
experienced, so too should have this request to CRTCMD. That is, the
following two errors would be seen for those three parameters that are
not forcing prompting even though the attempt was made to make them
mandatory via the MIN(1) specification:
CPD0263 "Required parameter not allowed after optional parameter.
Optional parameter assumed."
CPD0250 "Default value of &2 assumed for DFT parameter."
Thus /a/ possible /correction/ could be effected with the following
command source modification, along with the modification of the CPP to
accept the parameters in the new order that they appear in that updated
command source. The modified command source is included below, whereby
the PGM parameter is moved to the fourth parameter, but its Prompt
Position [its "Order prompt is displayed"] is explicitly requested to be
the first:
CMD PROMPT('Start DFC Engine')
PARM KWD(PATH) TYPE(*PNAME) LEN(1000) MIN(1) CASE(*MIXED)
PROMPT('Home IFS Directory')
PARM KWD(PORT) TYPE(*UINT4) MIN(1) PROMPT('Listening Port')
PARM KWD(NUMCHLD) TYPE(*UINT4) MIN(1) PROMPT('Number Of Children To
Start')
PARM KWD(PGM) TYPE(QPGM) PROMPT('Engine Program Name' 1)
QPGM: +
QUAL TYPE(*NAME) LEN(10) DFT(TRAN_ENGV2)
QUAL TYPE(*NAME) LEN(10) DFT(*CURLIB) SPCVAL((*CURLIB *CURLIB))
MIN(0) PROMPT('Library')
PARM KWD(JOBNAME) TYPE(*NAME) LEN(10) DFT(DFCENG) PROMPT('Name Of
This Job')
PARM KWD(JOBD) TYPE(QUAL_JOBD) MIN(1) PROMPT('Job Description')
QUAL_JOBD: +
QUAL TYPE(*GENERIC) DFT(*ALL) SPCVAL((*ALL))
QUAL TYPE(*NAME) DFT(*ALLUSR) SPCVAL((*ALL) (*ALLUSR) (*CURLIB)
(*LIBL) (*USRLIBL)) +
PROMPT('Library')
PARM KWD(USER) TYPE(*NAME) LEN(10) DFT(DFCUSER) PROMPT('Username To
Run Under')
PARM KWD(DEBUG) TYPE(*CHAR) LEN(4) RSTD(*YES) DFT(*NO) VALUES(*YES
*NO) PROMPT('Debug On?')
--
Regards, Chuck