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



Yes, as soon as the code tried to reference a subfield of @PARMS, it got an MCH3601. As does eval ptrPARMS:x in debug.

I was under the impression that parameters are passed by reference, i.e. a pointer is passed. Is that not the case? Or I cannot reference any given parameter's pointer by defining the parameter as a pointer?

--
*Peter Dow* /
Dow Software Services, Inc.
909 793-9050
petercdow@xxxxxxxxx <mailto:petercdow@xxxxxxxxx>
pdow@xxxxxxxxxxxxxx <mailto:pdow@xxxxxxxxxxxxxx> /



On 10/6/2016 1:52 PM, CRPence wrote:
On 06-Oct-2016 15:41 -0500, Peter Dow wrote:
On a v5r4 system I have a CLLE program with

DCL &RC *CHAR 2
DCL &CALLER *CHAR 10
DCL &PARMS *CHAR 111
CALL PGM(OB0050AN) PARM(&RC &CALLER &PARMS)

And an SQLRPGLE program that has

d OB0050AN pi
d @RETURNCODE 2a
d @CALLER 10a
d ptrPARMS *

d @PARMS e ds extname(OB0050PR) based(ptrPARMS)

When I debug the SQLRPGLE program, I can see the values passed for
@RETURNCODE and @CALLER, but for ptrPARMS it shows SPP:*NULL.

Hmm. I would think there would also be a MCH3601 exposed, somehow, to reveal\indicate why the value is presented as *NULL; what does EVAL ptrPARMS:X show?


What am I missing?

The interface does not match to the CALL. The CL would either need to pass the address of (&PARMS) [i.e. CHGVAR (&cl_ptrPARMS) (%addr(&PARMS)) and then CALL … PARM(&RC &CALLER &cl_ptrPARMS)], or the RPG would need to change to type of ptrPARMS to be 111A [and probably best also renamed to something like data_ofPARMS].



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.