× 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.



Hi, Rory:

For OPM languages, it depends on the HLL in question. OPM CLP always assumes a fixed number of parameters, and always sets both MIN and MAX to the exact number of parameters coded on the PGM statement. RPG/400 allows a variable number of parameters, and always sets MIN to zero and MAX to the exact number of parameters you coded as *ENTRY PARMs.

The underlying OPM MI architecture allows you to specify both the minimum and maximum number of parameters expected, and if either is incorrect, you get this *DIAGnostic message in the CALLing program:

CPD0172 Parameters passed on call do not match those required

followed immediately by the *ESCAPE message:

CPF0001 Error found on CALL command

For ILE, all bound *PGMs always accept any number of parameters, and so, if you do a DSPPGM on any bound ILE *PGM, you will see the minimum number of parameters is always zero and the maximum number of parameters is always 99. :-o

HTH,

Mark S. Waterbury

> Rory Hewitt wrote:
All,

Probably a silly question, but I haven't managed to find an *absolute*answer:

If I call a program passing too many parameters, what will happen? I'm
assuming the called program won't throw a fit, but will OS/400 take note? I
know some IBM programs throw an error, but I assume (again!) that this is
program-specific code which checks for too many parameters.

If I define a prototype for the called program with the extra parameter
being CONST, could there be any memory overwriting problems? I don't think
so, but I'd like to know.

Although this is the RPG list, if anyone can confirm the behavior for other
languages as well, that would be nice :-)

Thanks,

Rory


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.