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



For one thing, you have to increment &MSGKEY in order to get all the messages. When you do your RCVMSG, MONMSG CPF2410 to take care of a message key not found - do a RMVMSG of the CPF2410.

Add another SNDPGMMSG after your call, to get an &ENDKEY. Then make your loop end when your &MSGKEY is *GE *ENDKEY.

If you added the increment, then this could remove ALL messages generated during the called program - you probably want to be selective - RCVMSG MSGID(&MSGID) is needed, then.

IBM has a great document on this - http://tinyurl.com/cbe4nth will get you there. Examples in CL and in ILE/C - the latter can easily be adapted to RPG, of course, but not needed here.

HTH
Vern*
*
On 6/11/2012 1:05 PM, Gqcy wrote:
I have a RPGLE that generates LOTS of RNX0114 messages.

when the program is done, I want to remove those messages from the jobs
message queue.

However, I can't figure out how to get to those messages. I think I need
some different setting for PGMQ:

SNDPGMMSG MSG('/* Start of Notes Program. */') +
KEYVAR(&STARTKEY)

CALL NOTESPGM11

CHGVAR VAR(%BIN(&MSGKEY 1 4)) VALUE(%BIN(&STARTKEY
1 4))
toploop:
RCVMSG PGMQ(*PRV) MSGTYPE(*EXCP) MSGKEY(&MSGKEY) +
RMV(*YES)
MONMSG MSGID(CPF2415) EXEC(GOTO BOTTOM)
GOTO toploop
BOTTOM:
ENDPGM

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.