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



Jeff,

The way you have the send program message API coded it is sending a *ESCAPE message up three levels from QMHSNDPM. When QMHSNDPM sends the message it is the current call stack, your procedure is the second level and whatever invoked your procedure is the third level. So why did I say try 0? You have to start counting from some point.

You are going to have to play around with the call stack count. If your procedure is called from the body of your program try changing it to 4. If from some other sub-procedure and you want the message sent to the program try 5. And so forth. You can always put the program in debug, display the job , then the call stack and count back up the stack where you want the message sent.

You can always try sending a *DIAG message to call stack entry *EXT. This will definitely send the message to your job log.

Gary



-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jeff Young
Sent: Tuesday, August 28, 2012 9:30 AM
To: RPG programming on the IBM i / System i
Subject: Re: Problem with QMhSndPm

Gary,
I changed the CallStkCnt to 0, but it did not effect the results.
I am still not receiving the message in my job log.

Thanks,



On Tue, Aug 28, 2012 at 12:25 PM, Monnier, Gary <Gary.Monnier@xxxxxxxxx>wrote:

Jeff,

Try setting your CallStkCnt to 0?

Gary

-----Original Message-----
On Tue, Aug 28, 2012 at 8:56 AM, Jeff Young <jyoung0950@xxxxxxxxx> wrote:

I am using Scott's DIE procedure to trap exceptions in my program
and send an ESCAPE message, but even though the QMhSndPm API is
called, I am not receiving the message.
I have verified that the MSG parm contains the text I wish to send.
Below is the code I am using:

D Die PR

D Msg 256A Const Varying



P Die B

D Die PI

D Msg 256A Const Varying

D QMhSndPm PR ExtPgm('QMHSNDPM')

D MessageID 7A Const

D QualMsgF 20A Const

D MsgData 256A Const

D MsgDtaLen 10I 0 Const

D MsgType 10A Const

D CallStkEnt 10A Const

D CallStkCnt 10I 0 Const

D MessageKey 4A

D ErrorCode 256A

D dsEC DS

D dsECBytesP 10I 0 inz(%size(dsEC))

D dsECBytesA 10I 0 inz(0)

D dsECMsgID 7

D dsECReserv 1

D dsECMsgDta 240

D MsgLen S 10I 0

D TheKey S 4A

/FREE

MsgLen = %CheckR(' ' : Msg);

If MsgLen < 1;

Return;

EndIf;

Dump;

// Send Escape Message

QMhSndPm ('CPF9897'

: 'QCPFMSG *LIBL'

: Msg

: MsgLen

: '*ESCAPE'

: '*'

: 3

: TheKey

: dsEC);

Return;

/END-FREE

P E

T-hanks,

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




--
Rory Hewitt

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

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




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


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.