How do you implement the email feature of CA 7?
Release: 12.0, 12.1
Component: 7
This procedure will help you implement the email feature. The email feature provides the capability to generate and send emails from the CA 7 address space using standard SMTP protocol. This feature is primarily intended for automatic problem notification, such as job abends. However, it can be used to notify end-users or other staff about any status.
The following procedure describes how to implement email support.
//SYSTCPD DD DSN=your.tcpip.DATA,DISP=SHR
NOTE: The SYSTCPD DD statement points to the data set containing system-wide TCP/IP definitions. This DD statement may be omitted from the JCL Procedure if there is only one TCP/IP system executing in the environment. If there are multiple TCP/IP environments, then code the SYSTCPD DD statement pointing to the definition library for the TCP/IP.
NOTE: If TCP/IP is not in the link list, then the TCP/IP STEPLIB data sets must be added to the CA 7 STEPLIB concatenation.
EMAIL,ESERVER=email.com,
EADDRLIB=your.CAIEADDR,
EMAILLIB= your.CAIEMAIL,
EFROM=CA-7,
EPORT=25,
ETIMEOUT=10
2. Members of the EADDRLIB PDS are used to build the list of email addresses to which emails are sent. The member name is specified by the TO=xxxxxxxx keyword on the /EMAIL command. You will also need to provide a TXT keyword on the /EMAIL command to provide the message to send. We provide four sample messages to send for Job failures, abends, late jobs and jobs ending. These samples can be found in the CAIEMAIL Library.
3. A batch utility, CAL2EMLT, is available to test the email interface in an isolated environment. The utility can be used to test different SMTP (email) servers, new templates, and/or new email address members. CAL2EMLT provides information about a "dummy" job so that email templates with variables referencing job information will be displayed with realistic data (See L2EMAIL member in SAMPJCL library).
4. You need to be sure that you have L2SCEMAL defined to external security just like you would have for other L2xxxx commands.
To generate automatic email notification for job failures, you will have an ARFSET set up to respond with a /EMAIL command.
Below is a sample ARFSET that gets invoked for a job when a return completion 'rc = 0004' and then issue the /EMAIL command to send an email to the email address(es) listed in the member called SUPPORT with the message found in library CAIEMAIL member @JOBEND. For this to work consistently, you would also need to set the COND-CODE and RO on the DB.1 screen to have CC 4 seen as a failure
----------------------- ARF CONDITION EDIT FOR SUPPORT --------------
FUNCTION: LIST (ADD,DELETE,EXIT,FORMAT,LIST,REPL,SAVE,SR,SS) DEFC
TYPE: JC SYS EQ * SID EQ 0 RSTC GE 0 EM EQ * DEFID: 1
FROM: 01011975 0001 TO: 12312074 2359
JC, SC TST: STEP EQ * PROC EQ * PGM EQ *
CC/ABENDS : CC EQ 0004 __ ??? GE 000 __ ??? GE 000 __
??? GE 000 __ ??? GE 000 __ ??? GE 000
EC, EE, IS, LB, LE, LS TST:
RO: DATE: TIME: AO: INT/ADJ:
RESPONSES:
1: AC,M=/EMAIL,TO=SUPPORT,TXT=@JOBEND,JOB=&JOBNAME
2:
3:
FINAL -- DISP : N CA-11?: N BYPGDG: N USAGE: PROCESS: CC:
START : END :
PROGRAM: AR32 MSG-INDX: 00 -- AR.3.1 -- yy.ddd / hh:mm:ss
The job using the arfset must be defined in DB.1 with ARFSET: arfname .
REQUIREMENTS: HOLD: JCL-OVRD: USE-OVRD-LIB: VERIFY: MAINT:
SATISFACTION LEAD-TIME: JOB: DSN: ARFSET: arfname