View previous topic :: View next topic
|
Author |
Message |
gpowell382
New User
Joined: 25 Aug 2005 Posts: 31 Location: USA
|
|
|
|
I have a requirement to send an email message when the previous job aborts. I am using z/OS 01.07.00 JES version JES2 - JES level S 1.7 -TSO version 3.6.0. Is there a set up? It goes to EOJ, but does nothing.
I tried the following:
Code: |
//JS10 EXEC PGM=IKJEFT01,
// DYNAMNBR=100,
// REGION=1M
//ABNLNODP DD DUMMY
//SYSIN DD DUMMY
//SYSTSIN DD *
XMIT (N O D E).SMTP FI(MAIL) SEQUENTIAL NOEPILOG NOLOG NOPROLO
/*
//MAIL DD *
HELO (N O D E)
MAIL FROM: <USER ID@N O D E>
RCPT TO: <EMAIL address>
DATA
FROM: Email address
TO: Email address
SUBJECT: IKJEFT01 HAS BEEN RUN.
IKJEFT01 HAS BEEN RUN.
.
QUIT
/*
//SYSTSPRT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
|
|
|
Back to top |
|
|
Frederic Lavoie
New User
Joined: 07 May 2007 Posts: 6 Location: Ottawa
|
|
|
|
Have you tried the IF (ABEND) in the JCL?
Code: |
//*
//STEP01 PGM=prog1
//*
//IFCC1 IF (ABEND)
// THEN
//SNDEMAIL EXEC SMARTSND
//*
//SMARTSND.MAIL DD *
AN ERROR OR ABEND HAS OCCURED! PLEASE VERIFY THIS JOB!
/*
//IFCC1 ENDIF
//*
|
|
|
Back to top |
|
|
gpowell382
New User
Joined: 25 Aug 2005 Posts: 31 Location: USA
|
|
|
|
Is there a manual or something? I to send a E-MAIL message to valid email address when this jobs aborts |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You might use the COND=ONLY in the e-mail step. With this specified, the e-mail step will only execute if the job has abended.
The manual you want for condition codes is the JCL manual linked to form the "Manuals" link at the top of the web page. |
|
Back to top |
|
|
gpowell382
New User
Joined: 25 Aug 2005 Posts: 31 Location: USA
|
|
|
|
I submitted the JCL to SMTP by itself and I cannot get it to email a message. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This has me a somewhat confused
Quote: |
I submitted the JCL to SMTP by itself and I cannot get it to email a message. |
How did you "submit the jcl to smtp by itself"? I would think that you submitted a job via JES? What error message(s) are being presented. Please clarify why you cannot get it to email a message.
I may have mis-read your original post - if you want to execute the email step when the "previous job" abends, i'd suggest that you do it in the same job, but only send the email when the job abends (COND=ONLY).
If you are testing the email step stand-alone and it is not "doing anything", look at all of the sysout datasets for any info. You will be ahead if you find an already working batch e-mail on your system, and use the same method for your execution. |
|
Back to top |
|
|
gpowell382
New User
Joined: 25 Aug 2005 Posts: 31 Location: USA
|
|
|
|
I understand COND=ONLY, but is it possible to test this job step by itself.
Note: I have tried to run SMTP by itself and I did not receive an error message nor did I get a email. X=system name This is what I am getting
READY
XMIT XXXX.SMTP FI(MAIL) SEQUENTIAL NOEPILOG NOLOG NOPROLOG
INMX000I 0 message and 10 data records sent as 14 records to XXXXXX.SMTP
INMX001I Transmission occurred on 05/14/2007 at 11:03:40.
READY
END |
|
Back to top |
|
|
gpowell382
New User
Joined: 25 Aug 2005 Posts: 31 Location: USA
|
|
|
|
Thanks for your help, but I found out it is a security issue as to why I cannot send an email using SMTP |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Thank you for posting your finding.
It may help another person with a similar problem later. |
|
Back to top |
|
|
|