GO online to the IBM website that has manuals.
Then find the CL manuals and look up the command you want to monitor.
A list will be provided for you.
The <help> for each (IBM) command includes a list of all of the message identifiers that the command might send. Scroll to the bottom of the <help>. Determine which of those you want to monitor for at that moment. If a message ID is sent that you choose not to monitor for, the program’s global error handler will be invoked. If a global MONMSG is not present or does not include the message ID that was sent, then any system default handler will be invoked.
Ranges of message IDs can be monitored: CPF9800 will catch CPF9801, CPF9802, CPF9803, up through CPF98FF; and CPF0000 would catch CPF0001 up through CPFFFFF. That is, by specifying trailing zeros, you are asking for the range of values that can fit within the trailing zero positions.