× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I think you are looking for the DEP statement.

Create a message id that contains the error text, then trigger the error text using DEP.

I imagine something like this could work:

DEP CTL(&USER *NE *CURRENT) +
PARM((&USER *EQ 'USER1') +
(&USER *EQ 'USER2') +
(&USER *EQ 'USER3')+
) NBRTRUE(*EQ 1) MSGID(XXX1235)

WHERE you create message id XXX1235 to contain your message like 'User id is not allowed'



Like this example from CPYTOSTMF:

DEP CTL(&CVTDTA *EQ 2) PARM((TBL *N *N)) +
NBRTRUE(*EQ 1) MSGID(CPDA086)
DEP CTL(TBL) PARM((&CVTDTA *EQ 2)) NBRTRUE(*EQ +
1) MSGID(CPDA098)



Message ID . . . . . . . . . : CPDA086
Message file . . . . . . . . : QCPFMSG
Library . . . . . . . . . : QSYS

Message . . . . : TBL parameter required with CVTDTA(*TBL).
Cause . . . . . : You specified the CVTDTA(*TBL) parameter without
specifying the TBL parameter.
Recovery . . . : Either change the value on the CVTDTA parameter or specify
the TBL parameter. Then, try the command again.



Message ID . . . . . . . . . : CPDA098
Message file . . . . . . . . : QCPFMSG
Library . . . . . . . . . : QSYS

Message . . . . : TBL parameter can only be specified with CVTDTA(*TBL).
Cause . . . . . : A table name was specified (TBL parameter) and a value of
*TBL was not specified for the CVTDTA parameter.
Recovery . . . : Remove the TBL parameter or change the CVTDTA parameter to
CVTDTA(*TBL). Then try the request again.


https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/cl/dep.htm



Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the author and do not necessarily represent those of the company.
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of James H. H. Lampert
Subject: Question about command parameters (PARM statement)

In defining a command's parameters, I see a number of ways to define
what values are specifically *allowed* for a parameter.

Is there a way to define several (in this case, ten) distinct values
*prohibited* for a parameter?

In this case, the parameter is a value to be passed to a SBMJOB's "USER"
parameter, and so it should accept either a valid SNAME or "*CURRENT,"
but reject the user profiles that are prohibited for that parameter of
SBMJOB.

And if I can reject it at the command level, rather than the CPP level,
then a wrong value will of course keep it from compiling in a CL
program, and make it fail a syntax check in SEU.

--
JHHL

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.