![]() If an unmonitored error occurs in the regular routine, control branches to the ABEND label. Then put the commands that you want to run after the comment that indicates the beginning of the regular routine. To use this template, you will have to declare any variables or files you use after the PGM command and before the global MONMSG. Sndpgmmsg msgid(cpf9898) msgf(qcpfmsg) msgtype(*escape) + Sndpgmmsg msgid(&msgid) msgf(&msgf) msgtype(*diag) + Rcvmsg msgtype(*last) msgdta(&msgdta) msgid(&msgid) + * Routine to handle unexpected errors */ Sndpgmmsg msgid(cpf9898) msgf(qcpfmsg) msgtype(*comp) + Rcvmsg pgmq(*same) msgtype(*info) sender(&sender) rmv(*yes) Sndpgmmsg msg(' ') topgmq(*same) msgtype(*info) keyvar(&msgkey) ![]() Here is a CL program template I like to use: The other thing you need is an error routine that sends an escape message. The first thing you need is a global monitor message (MONMSG) command that branches to an error routine. You can prevent the user from seeing an inquiry message when something goes wrong.
0 Comments
Leave a Reply. |