Ü   MONMSG / Difference between cpf0000 and cpf9999 in as400

 

 

Before we go for the difference between CPF0000 and CPF9999, we need to understand how the MONMSG works.

First, we can monitor for a specific message, e.g.

    MONMSG    MSGID (CPF9821)

 

Or we can monitor for a list of messages, e.g.

    MONMSG    MSGID (CPF9821 CPF9822 ……  CPF9830)

 

Now if we want to catch all the messages that start with CPF98.., then we can go for the below MONMSG:

  MONMSG    MSGID (CPF9800)

 

Now if we want to catch all the possible generic messages for CPF…., we can use the below MONMSG:

  MONMSG    MSGID (CPF0000)

 

To have more generic message monitor, we can go for:

  MONMSG    MSGID (CPF0000 MCH0000) EXEC (GOTO ERROR)

 

But now suppose we have given the generic message handling MONMSG command as above, but the program generates a message that is not in this generic list of messages then that will not be handled.

That unhandled message is converted into CPF9999 by our system automatically.

Hence, all the unhandled messages are converted to CPF9999, which actually is being handled by our generic MOMSG command.

 

Example

Suppose there is any program which needs parameter value (file name) to be passed, but actually we are not passing the value in this case. In the program when we try to delete the file then what we get  an error CPD0071.

Hence, here this unhandled exception is converted to CPF9999 and then it is handled via CPF0000(GENERIC MSG HANDLER).

 





User Comments:





Copyright © Go4as400.com, 2013-2017. Copyright notice