× 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 30/05/2008, at 4:56 AM, Zachary Johnson wrote:

I can't find exactly what I'm looking for in the archives and I'm done
with trial and error so here's the question. I am writing a message
handling service program using QMHSNDPM. What I want to happen is to
collapse the call stack back to the last PEP. I can't seem to get the
parameters right to accomplish this. All the RPG's run out of the
default activation group so *CTLBDY doesn't seem to work,

If you're using ILE then you REALLY need to fix that but that's a separate issue.

*PGMBDY
doesn't work because it's a service program I guess.

When using QMHSNDPM in a service program the *PGMBDY is the call stack entry for the first procedure invoked in the service program-- not terribly useful in my experience.

Anyway I've tried
just about everything with the parameters. So my next step is going to
be to use the API to get the call stack info so I can use that to find
the last PEP, but I thought surely there must be a way and I'm just
missing something.

I think you'll find this utility much more usable if you let your caller decide where to send the message. Have them pass in the call stack entry and relative counter. Make these optional parameters and use sensible defaults (like * and 1). Your caller can then pass the PEP entry derived from _QRNP_PEP_ plus the program name in the PSDS (presuming RPG IV). Similar can be done for COBOL (_Qln_pep), CL (_CL_PEP), C (_C_pep). You could simplify this process by having your caller pass in their own program name and then use *PGMNAME for the call stack entry.

If you still want to derive the PEP then you could accomplish that using the QMHSNDPM and QMHRCVPM APIs to determine your caller's program name, or you could use QWVRCSTK to interrogate the call stack. Specify the program name in the Call stack entry qualification parameter and *PGMNAME for the Call stack entry itself.

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