- 論壇徽章:
- 0
|
The 0 character is treated as a wild card for the purposes of error monitoring, so CPF0000 says to monitor for any error.
First, you can monitor for a specific message, e.g.:
MONMSG MSGID(CPF9801)
Or you can monitor for a list of specific messages, e.g.:
MONMSG MSGID(CPF9801 CPF9802 CPF9810)
Next, you can monitor for a whole group of related messages, using a
"generic" designation such as:
MONMSG MSGID(CPF9800)
-- this will trap any message that begins with CPF98xx.
Next, you can monitor for a truly generic message, such as:
MONMSG MSGID(CPF0000)
-- this will trap any message that begins with CPFxxxx.
-- typically this is used in a "global message monitor" statement at the start of the program, e.g.:
MONMSG MSGID(CPF0000 MCH0000) EXEC(GOTO ERROR)
For these message IDs to be considered a "generic pattern" it must end in "00" or "0000".
Finally, if a CPF message occurs and is not "handled" in the CL
program, in other words, there was no active MONMSG that matched the message ID either exactly
or as a generic pattern, then it is converted into a CPF9999 and that exception is raised ...
so you can also monitor for CPF9999. But, due to this extra processing that occurs before it is
converted to CPF9999, you may get additional messages, such as the one that tells you there was
an unhandled exception and asks if you want a "dump" etc.
-----------------
CPF9999 will also catch other messages that are not prefixed with CPF. MCH messages might occur and CPF9999 will catch those whereas CPF0000 will not. |
|