|
On 28/09/2009, at 11:35 PM, Vern Hamberg wrote:
There is still no such thing as a count of parameters that I remember,
so put a MONMSG MCH3401 (MCH3601? I forget which) after the first use of
the optional parameters, then use a GOTO to skip around the new code.
There might also be some newer commands for handling errors since V5R3
and up - not sure. Thought I'd seen something about DO WHILE that
involved message IDs once at COMMON. But don't quote me on that.
It's MCH3601.
I presumed he meant how to avoid the error on call (CPF0001 preceded by CPD0172. Making it a CLLE will avoid that. I didn't consider how he would handle KNOWING which ones were passed or not (but I note that was in his initial question).
Dealing with optional parameters in CL requires you to define internal variables for each of the optional parameters. Copy the optional parameter to the internal version. Monitor for MCH3601 and assign a sensible default (remembering to remove the exception message from the joblog). Once past all the parameter checks the body of the code only ever references the internal variables.
Returning information to the caller is similar. Copy the internal variable to the optional variable and deal with any MCH3601.
Don't do a global MONMSG for MCH3601.
Regards,
Simon Coulter.
--------------------------------------------------------------------
FlyByNight Software OS/400, i5/OS Technical Specialists
http://www.flybynight.com.au/
Phone: +61 2 6657 8251 Mobile: +61 0411 091 400 /"\
Fax: +61 2 6657 8251 \ /
X
ASCII Ribbon campaign against HTML E-Mail / \
--------------------------------------------------------------------
As an Amazon Associate we earn from qualifying purchases.
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.