ESP Workload Automation

 View Only

 Customizing email notifications from ESP.

Keith Grizzell's profile image
Keith Grizzell posted Aug 24, 2022 03:21 PM
Currently we have many jobs setup to send notifications to different groups if a job should fail. Currently the subject and text are limited to the subject and message body below. I was wondering if it is possible to change these for specific jobs to include more in the subject line and body of the notification emails? These would for both JOB and NT_Job executions. I see there are examples in the manual but they appear to be specific to people soft jobs or maybe I am just not understanding.

I have tried a couple of variations on the EMAILSUBJECT subject _text and EMAILSUBJECT "KEITHTST ENDED" with errors during each simulation.


Subject: Workload Object OSPEC011 in appl PRDCOR60.319 Failed

ESP417W Workload Object OSPEC011 in appl PRDCOR60.319 Failed at 13.01.07 on 2022AUG24, ExitCode=1

Latest test job def
JOB KEITHTST
DATASET 'SYS3.JCLLIB'
RUN DAILY
NOTIFY JOBEND MAILBOX(KXG)
EMAILSUBJECT "KEITHTST HAS ENDED"
ENDJOB

Simulation result
==>ESP101W INVALID COMMAND, EMAILSUB
==>ESP1800I ABOVE ERROR OCCURRED ON FOLLOWING STATEMENT IN JOB KEITHTST
==>ESP1007I EMAILSUBJECT "KEITHTST HAS ENDED"
ENDJOB
SIMULATION OF EVENT SPRODID.USERJOBS AT 00.00.00 ON THURSDAY AUGUST 25TH, 2022

Rick Romanowski's profile image
Rick Romanowski

You can update the SUBJECT in the MAILBOX

MAILBOX: Set up mailboxes (broadcom.com)

SUBJECT('text')
Specifies the subject line for all messages to the mailbox. The text that you specify overrides the standard message subject line. The SUBJECT can be up to 255 characters long. For more information about standard message subject lines in job status notifications, see the 
Using
 section.

Does that provide what you need?

Keith Grizzell's profile image
Keith Grizzell
Thanks Rick that is helpful. It may not work from what is being asked of me by the programmers. They have about 30 jobs that they want notified for. I currently have a mailbox setup for them that sends that standard email notification no matter which job may fail. They are wanting more specific information that pertains to each individual job included in the email. It appears that the mailbox is a "one size fits all" and it really isn't set up to give specific information about each job that may fail.
Rick Romanowski's profile image
Rick Romanowski
Another alternative is to create a Control Card Data Set(s) and reference it from JCL

Control Card Data Set
HELO <Fully qualified LPAR> 
MAIL FROM: <Valid Address>
RCPT TO: <Valid Address 1>
RCPT TO: <Valid Address 2>
DATA
FROM: <Valid Address>
TO: <Valid Address 1>
TO: <Valid Address 2>
SUBJECT: *** ESP ERROR REPORT UATM ON DVLP ***
MIME-VERSION: 1.0
CONTENT-TYPE: TEXT/HTML;
BOUNDARY="SIMPLE BOUNDARY"
<FONT FACE="COURIER" SIZE="+1" COLOR=BLUE>
<PRE>



JCL Email Step
//***************************************************************     
//*  EMAIL NOTIFICATION STEP EXECUTE SMTP IN BATCH              *    
//***************************************************************    
//*                                                                  
//SN001     EXEC PGM=IEBGENER,REGION=6144K,TIME=720                  
//SYSPRINT  DD SYSOUT=*                                              
//SYSUT1    DD DISP=SHR,DSN=
<Control Card Data Set>  

//          DD DISP=SHR,DSN=
<Data Set with information to send>

//*                                                                   
//SYSUT2    DD SYSOUT=(B,SMTP)                                       
//SYSIN     DD DUMMY                                                 
//*