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



True - that call stack entry isn't available anymore.

What about the JOBLOG_INFO table function? If the message is in the job log, you should be able to retrieve it from there - and there is a column FROM_LIBRARY.

Maybe that should work.

HTH
Daniel


Am 29.03.2024 um 18:55 schrieb Thomas Raddatz <thomas.raddatz@xxxxxx>:

Hi Daniel,

Good point, but does not work in this case. The RPGUnit service program calls the test procedure inside a monitor block and in case of an unexpected error receives the escape message that caused the exception. At this time the call stack entry of the procedure that sent the escape message has already been removed from the call stack.

Compressed example code:

monitor;
callProcByPtr( proc );
on-error;
result.error = rcvExcpMsgInfo(); // ==> QMHRCVPM
endmon;

Thomas.

-----Ursprüngliche Nachricht-----
Von: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> Im Auftrag von Daniel Gross
Gesendet: Freitag, 29. März 2024 18:34
An: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Betreff: Re: How to get the program library name of a program that sent a message

Hi Thomas,

if no other format of the API is containing the library, I would go over the call stack - and simply try to select the correct row from the STACK_INFO table function.

HTH
Daniel


Am 29.03.2024 um 18:08 schrieb Thomas Raddatz <thomas.raddatz@xxxxxx>:

I already use the QMHRCVPM message to receive a message send by a program. The sender information of format RCVM0300 contains the program, module and procedure name as well as the statement number of the program that sent the message. But it does not contain the program library name.

However the program library name is displayed, e.g. if you do a DSPJOBLOG, prompt a message with F1 and switch to the message details with F9, e.g.:

From program . . . . . . . . . : RUCALLTST
From library . . . . . . . . : RPGUNITDVP
From module . . . . . . . . : PGMMSG
From procedure . . . . . . . : PGMMSG_sndEscapeMsgAboveCtlBdy
From statement . . . . . . . : 35600

Hence the information must be available somewhere. Hopefully not only for the operating system.

So does somebody know how to get the above information of a message send by a program?

Thomas.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.


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.