×
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.
On 07 May 2013 15:56, Sergey Kashyrin wrote:
1. I have ILE COBOL program (*PGM) with let say 3 parameter
The source shown will be created with *three* parameters for which
its compiled program object will accept a minimum of zero parameters and
a maximum of three parameters; i.e. per the declarative:
PROCEDURE DIVISION USING P1 P2 P3.
2. I am calling this program (dynamically) from other COBOL program let say
with 5 parameters - call is going thru, everything is okay.
The example given shows the CALL passing *three* parameters, not
five; i.e. per the USING:
CALL SUB USING P1 P2 P3.
3. I need to do the same call from C++ - I am getting MCH0802 (number of
parameters mismatch).
That call is coded to pass *five* parameters; i.e. P1 to P5 are the
arguments passed on the function invoked by address:
os_fct_ptr(p1, p2, p3, p4, p5);
The MCH0802 for its second level text apparently read: "Program
CALLER attempted to call program CALLEE with 5 parameters. Program
CALLEE expects a minimum of 0 and a maximum of 3 parameters."
Had the following call been coded within the program CBCALLER, to
truly pass *five* parameters, then that invocation would have effected
the same MCH0802 [of course with the proper name appearing for the
"caller"]:
CALL SUB USING P1 P2 P3 P4 P5.
What is wrong and how to avoid that ?
<<SNIP included sources>>
Call from the C program with the maximum number or *fewer* parameters
defined for the called program; i.e. per the following output of the
DSPPFM CALLEE [where zero is min, three is maximum]:
Program statistics:
Number of parameters . . . . . . . . . . . . . : 0 3
If the C++ provides a mechanism for a declarative for a parameter
list [like the MI does], then probably using an address of the chosen
parameter list, to match the /callee/ for any particular invocation.
As an Amazon Associate we earn from qualifying purchases.