Very Simple MAILSPLF sample that attempts to send a report via email. If the email fails (CPF9898), the job will send a message to QSYSOPR.
/***********************************************************/ /* ATTEMPT TO SEND REPORT VIA MAILSPLF. IF ERRORS OCCUR, */ /* SEND A MESSAGE TO QSYSOPR. */ /***********************************************************/ MAILSPLF FILE(RPT100) JOB(*) + TOADDRESS('[email protected]') /* SEND ERROR MESSAGE IF MAILSPLF ERROR OCCURS */ MONMSG MSGID(CPF9898) EXEC(DO) SNDMSG MSG('Error occurred while emailing report to + email recipient') TOUSR(*SYSOPR) ENDDO
Still have questions? We can help. Submit a case to Technical Support.