Your prompt override program should include error handling.
If the prompt override program detects an error, it should do the following:
For example, if you need a message saying that a library does not exist, add a message description similar to the following:
ADDMSGD MSG('Library &2 does not exist') + MSGID(USR0012) + MSGF(QGPL/ACTMSG) + SEV(40) + FMT((*CHAR 4) (*CHAR 10))
This message can be sent to the calling program of the prompt override program by specifying the following in the prompt override program:
SNDPGMMSG MSGID(USR0012) MSGF(QGPL/ACTMSG) + MSGDTA('0000' ∨∨ &libname) MSGTYPE(*DIAG)
After the prompt override program sends all the necessary diagnostic messages, it should then send message CPF0011. To send message CPF0011, use the Send Program Message (SNDPGMMSG) command as follows:
SNDPGMMSG MSGID(CPF0011) MSGF(QCPFMSG) + MSGTYPE(*ESCAPE)
When message CPF0011 is received, message CPD680A is sent to the calling program and displayed on the prompt screen to indicate that errors have been found. All diagnostic messages are placed in the user's job log.