Thanks Jon,
you are right, there is a logic to determine when to use the last two
parameters and it seems the CL with 3 parameter will not enter that logic.
A error MCH0801 will pop up if I use that last two parameters out of the



message: 1
date: Tue, 17 Apr 2012 13:04:39 -0400
from: Jon Paris <>
subject: Re: RPG still works even the input parameters are not match

On 2012-04-17, at 12:53 PM, rpg400-l-request@xxxxxxxxxxxx wrote:

I'm doing some RPG programs' development and I found that some of these
require more input parameters from their caller (e.g. a CL program), I
confuse that they still working even the number of the parameters are not
match, for example, RPG A has 5 input parameter and its caller CL B only
gives it 3.

As long as no attempt is made to _access_ the unpassed parameters then it
will not cause a problem. I would guess that there is some logic in place
that ignores the last two parameters if a specific value occurs in one of
the first three.

Ideally the program should be testing (%Parms) the number of parameters
passed and issuing an error if more than the number passed are required.
However it is not at all uncommon for a sloppy programmer to just ignore
the possibility of such an error and rely instead on the

Jon Paris

This thread ...

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

This mailing list archive is Copyright 1997-2020 by 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].