Not misleading - this is a common requirement. You'd put your parameters that specify the "key" first, then the parameters used for return values. Then do something like CHGVAR &RTNVAR1 &RTNVAR1 with MONMSG MCH3601 - set some logical variable to control whether to do the processing for that variable - done, and done!
----- Original Message -----
Sorry my example was misleading.
I do NOT want to do positional parms.
I want to have a command GetEnvr and retrieve only a few (or one) of the values and NOT be forced to set up variables for each parm.
Also would like to be able to add parms in future without old pgms crashing because they didn't have all parms.
Thanks
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Friday, April 12, 2013 5:03 PM
To: Midrange Systems Technical Discussion
Subject: Re: CL command creation
On Fri, Apr 12, 2013 at 5:11 PM, Stone, Joel <Joel.Stone@xxxxxxxxxx> wrote:
I would like to build a command to return sysName and libName.
But, I would like the variables to be optional when using the command.
I would like the following to be functional:
GetEnvr &sysname &libname
Also
GetEnvr &libname
As Vern points out, I may have read too quickly. You could be asking
specifically about CMD issues, rather than CL program issues. So now
I'm going back and rereading your question. And what is now jumping
out at me is:
Are you trying to make the command callable by positional parameters?
If so, does your example mean that you want any call with one
parameter to retrieve the library, and any call with two parameters to
retrieve the system name in the first parameter and the library name
in the second? Or do you mean you want to be able to pass just one
parameter, and have that parameter be either system or library (chosen
by the caller)? (If yes to this last question, then I would imagine
you have to make the parameters keyword-only rather than positional.)
John
As an Amazon Associate we earn from qualifying purchases.