Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Slight CMD problem with DFT() keyword using QUAL

300 views
Skip to first unread message

Mr. K.V.B.L.

unread,
Mar 27, 2013, 11:37:58 AM3/27/13
to
I have a parameter that is a two-parter: a library/pgm thing. I've divided the path up into two parts using the QUAL keyword. I'd like to have a default value of TRAN_ENGV2 for the first parameter, but it won't show up. The second works fine. Anyway, when I run it I just get a blank space in the first parameter.

PARM KWD(PGM) TYPE(QPGM) MIN(1) PROMPT('Engine Program Name')
QPGM: QUAL TYPE(*NAME) LEN(10) DFT(TRAN_ENGV2)
QUAL TYPE(*NAME) LEN(10) DFT(*CURLIB) SPCVAL((*CURLIB *CURLIB)) PROMPT('Library')

Robert Comer

unread,
Mar 27, 2013, 1:33:51 PM3/27/13
to
I think you need single quotes around TRAN_ENVG2.

QPGM: QUAL TYPE(*NAME) LEN(10) DFT('TRAN_ENGV2')

Ken Sims

unread,
Mar 27, 2013, 11:56:37 PM3/27/13
to
On Wed, 27 Mar 2013 08:37:58 -0700 (PDT), "Mr. K.V.B.L."
<kenvery...@gmail.com> wrote:

Remove MIN(1) from the PARM statement. Having MIN(1) and specifying a
default value are not compatible. If you look at the compiler
listing, you'll see a message about it.

--
Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.

CRPence

unread,
Mar 27, 2013, 11:59:07 PM3/27/13
to
On 27 Mar 2013 08:37, Mr. K.V.B.L. wrote:
> I have a parameter that is a two-parter: a library/pgm thing.
> I've divided the path up into two parts using the QUAL keyword. I'd
> like to have a default value of TRAN_ENGV2 for the first parameter

--> DFT specified for each QUALifier of the first parameter

> , but it won't show up.

--> [it=] the default value specified for the first Qualifier

> The second works fine. Anyway, when I run it I just get a blank space
> in the first parameter.
>
> PARM KWD(PGM) TYPE(QPGM) MIN(1) PROMPT('Engine Program Name')
> QPGM: QUAL TYPE(*NAME) LEN(10) DFT(TRAN_ENGV2)
> QUAL TYPE(*NAME) LEN(10) DFT(*CURLIB) SPCVAL((*CURLIB *CURLIB)) PROMPT('Library')

In the listing produced for the CRTCMD compile request, there should
be found, a message CPD0259 stating that a "Required list or qualified
name of all optional elements or qualifiers not allowed." Basically
what that means in the context of the given source example, is that the
MIN(1) suggests that the parameter PGM() is required, but none of the
qualifiers had omitted a DFT() specification. At least one QUAL must
omit the DFT() to be congruent with the MIN(1) specification [which
makes the parameter /required/ to have a value specified] for the PARM.
That the existence of a /default value/ is mutually exclusive to the
definition of a /required parameter/ should be intuitively obvious, and
thus the compiler considers the error [of the extraneous /default/
specification] to be an oversight, and effectively just ignores the
specification of DFT() on the first QUAL; however also logging the
severity-10 message to inform of that non-fatal condition with the source.

I am not aware if or where there is an ENDSEV capability or a *SECLVL
to produce second-level text for the error messages generated by the
compiler. I used v5r3 to verify my presumption that the issue origin
was the MIN(1) specification, and at that release there appears to be no
means to ask the compiler to deal with either, but newer releases could
have added something; I did not look at the [newer] docs.

The second level text for the CPD0259 suggests:
"Recovery . . . : Either change the MIN value on the PARM or ELEM
statement to zero, or change the MIN value of one or more list elements
of the qualifiers on the ELEM or QUAL statements to a value greater than
zero."

--
Regards, Chuck

Mr. K.V.B.L.

unread,
Apr 5, 2013, 11:42:39 AM4/5/13
to
OK, I guess this is OK, but of course it causes 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?')

CRPence

unread,
Apr 5, 2013, 1:30:21 PM4/5/13
to
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
0 new messages