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. 

This is a nice way to notify users if a report doesn't get send correctly with MAILSPLF. 
/***********************************************************/           
/* ATTEMPT TO SEND REPORT VIA MAILSPLF. IF ERRORS OCCUR,   */           
/* SEND A MESSAGE TO QSYSOPR.                              */           
/***********************************************************/           
        MAILSPLF   FILE(RPT100) JOB(*) +                           
                     TOADDRESS('SUPPORT@RJSSOFT.COM')              
        /* 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.

Last Modified On: December 10, 2016