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



What I am finding out is that *PRV seems to be meaningless, or how I am
using it is wrong.
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*LAST) WAIT(0) RMV(*NO) +
MSGID(&MSGID) KEYVAR(&KEYVAR) RTNTYPE(&RTNTYPE)
DMPCLPGM
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*PRV) MSGKEY(*NONE) WAIT(0) RMV(*NO) +
MSGID(&MSGID) KEYVAR(&KEYVAR) RTNTYPE(&RTNTYPE)
DMPCLPGM

On the first dump I have
Variable Value Value in Hexadecimal
*...+....1 * . . . + . . . . 1
&KEYVAR ' ÷' 000003E1
&MSGID 'CPFB414' C3D7C6C2F4F1F4
&RTNTYPE '15' F1F5

and the second one has the same values. If I replace the MSGKEY on the
second RCVMSG with &KEYVAR then I get all blanks returned.

Now I being told that I have to shoot a message before and after any
processing, irregardless of whether or not I am doing this all in the same
program. Then I have to loop through those messages. They may come to me
in any order chosen and I just have to guess what one is the one I want?

Well, um, ok.

I modified this a little bit. I only shoot the second message if the
program aborts. And the diagnostic message I want is always the first one
after the message I shot before.

SNDPGMMSG MSG(TEST) TOPGMQ(*SAME) KEYVAR(&LOWKEY)
RMVMSG MSGKEY(&LOWKEY)

chgatr '/barneyphil' atr(*alwsav) value(*no)

MONMSG CPFB414 EXEC(DO) /* Object not changed */
/* Figure out why the object was not changed. Might not exist, or you
may +
not have authorization to it. */
SNDPGMMSG MSG(TEST) TOPGMQ(*SAME) KEYVAR(&HIKEY)
RMVMSG MSGKEY(&HIKEY)
/*-----------------------------------------------------------------*/
/* LOOP TO RECEIVE MESSAGES ON INACTIVE INVOCATION */
/*-----------------------------------------------------------------*/
CHGVAR %BIN(&MSGKEY 1 4) (%BIN(&LOWKEY 1 4) + 1)
LOOP:
RCVMSG PGMQ(*SAME (*)) MSGKEY(&MSGKEY) MSGID(&MSGID) RMV(*NO)
MONMSG CPF2410 EXEC(DO) /* HANDLE MSGKEY NOT FOUND */
RCVMSG MSGTYPE(*EXCP) RMV(*YES) /* REMOVE UNWANTED EXCEPTION */
GOTO SKIP
ENDDO
DMPCLPGM
SKIP:
CHGVAR %BIN(&MSGKEY 1 4) (%BIN(&MSGKEY 1 4) + 1)
IF (&MSGKEY *LT &HIKEY) GOTO LOOP

EndDo

Rob Berendt

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.