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



Hi, David:

MONMSG handles "exceptions" -- in your code fragment below, what will happen if CPF9801 _is_ sent? You are not handling that explicitly, so it will cause a CPF9999, unless you have a "global" MONMSG "catch-all" ... is that what you really want?

Based on your example below, here is a snippet of code that I use quite frequently in CL ...

DCL VAR(&EXISTS) TYPE(*LGL) LEN(1)
...
/* check if object already exists in target library */ CHGVAR VAR(&EXISTS) VALUE('1') CHKOBJ OBJ(&LIB/&OBJ) OBJTYPE(&TYPE) MONMSG MSGID(CPF0000) EXEC(DO) /* remove extraneous message from job log ... */
RCVMSG PGMQ(*SAME (*)) MSGTYPE(*EXCP) MSGKEY(*NONE) +
WAIT(0) RMV(*YES) CHGVAR VAR(&EXISTS) VALUE('0') ENDDO IF (&EXISTS) THEN(DO)
/* deal with that situation here ... */
ENDDO
Perhaps you can explain some specific scenarios you are trying to handle or deal with?

Regards,

Mark S. Waterbury

> David Gibbs wrote:
... a reverse MONMSG.

A way of executing code if a specific message is NOT encountered.

For example:

CHKOBJ OBJ(&LIBNAM/&OBJNAME) OBJTYPE(*PGM) MONMSG NOTMSGID(CPF9801) EXEC(<do something>)
david


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.