I'm now gonna try the API within the offending RPG,
just to see how will that works.
(It's a real booger of a program, and I didn't want to mess with it)
:)




On 6/11/2012 2:47 PM, Vern Hamberg wrote:
Hi

What is your LOG() parameter set to?

And maybe this is why the API call is better, in an RPG program - it
doesn't end up in the log, IIRC. The ILE/C example isn't too hard to
convert into RPG.

LOGCLPGM(*NO) should prevent those, as you've done.

On 6/11/2012 2:22 PM, Gqcy wrote:
Thanks Vern,
I had the increment, but failed in my copy/paste operation...
The following works.
BUT, instead of 500 RNX0114 messages, I now have twice the number of
RCVMSG commands in my log as I had Exception messages...

I have added a CHGJOB LOG(0) LOGCLPGM(*NO)
after my call to my notespgm11,
and set it back at the bottom.

Is there something different I should do to supress the RCVMSG commands?

> SNDPGMMSG MSG('/* Start of Notes Program. */') +

KEYVAR(&STARTKEY)
SNDPGMMSG MSG('Key is: ' *CAT&STARTKEY)
START: CALL PGM(NOTESPGM11)
CHGJOB LOG(0) LOGCLPGM(*NO)

SNDPGMMSG MSG('/* End of Notes Program. */') +
KEYVAR(&ENDKEY)
/* REMOVE EXCEPTION MESSAGES FROM JOBLOG */
CHGVAR VAR(%BIN(&MSGKEY 1 4)) VALUE(%BIN(&STARTKEY +
1 4))
TOPOLOOP:

RCVMSG PGMQ(*SAME (*)) MSGTYPE(*EXCP) +
MSGKEY(&MSGKEY) RMV(*YES)
MONMSG MSGID(CPF2415) EXEC(GOTO BOTTOM)
MONMSG CPF2410 EXEC(DO) /* HANDLE MSGKEY NOT FOUND */
RCVMSG MSGTYPE(*EXCP) RMV(*YES)
ENDDO
CHGVAR %BIN(&MSGKEY 1 4) (%BIN(&MSGKEY 1 4) + 1)
IF cond(%BIN(&MSGKEY)< %BIN(&ENDKEY)) THEN(GOTO TOPOLOOP)

BOTTOM:
> CHGJOB LOG(4 0 *SECLVL) LOGCLPGM(*YES)

ENDPGM




On 6/11/2012 1:41 PM, Vern Hamberg wrote:
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 ...

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.