IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Is it possible to send an email message when a JOB aborts


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gpowell382

New User


Joined: 25 Aug 2005
Posts: 31
Location: USA

PostPosted: Wed May 09, 2007 12:28 am
Reply with quote

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
View user's profile Send private message
Frederic Lavoie

New User


Joined: 07 May 2007
Posts: 6
Location: Ottawa

PostPosted: Wed May 09, 2007 12:47 am
Reply with quote

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
View user's profile Send private message
gpowell382

New User


Joined: 25 Aug 2005
Posts: 31
Location: USA

PostPosted: Wed May 09, 2007 12:58 am
Reply with quote

Is there a manual or something? I to send a E-MAIL message to valid email address when this jobs aborts
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 09, 2007 1:42 am
Reply with quote

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
View user's profile Send private message
gpowell382

New User


Joined: 25 Aug 2005
Posts: 31
Location: USA

PostPosted: Fri May 11, 2007 6:31 pm
Reply with quote

I submitted the JCL to SMTP by itself and I cannot get it to email a message.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 11, 2007 8:23 pm
Reply with quote

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
View user's profile Send private message
gpowell382

New User


Joined: 25 Aug 2005
Posts: 31
Location: USA

PostPosted: Mon May 14, 2007 8:36 pm
Reply with quote

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
View user's profile Send private message
gpowell382

New User


Joined: 25 Aug 2005
Posts: 31
Location: USA

PostPosted: Fri May 25, 2007 12:15 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri May 25, 2007 12:42 am
Reply with quote

Thank you for posting your finding.

It may help another person with a similar problem later.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. how can I proof that message was post... Java & MQSeries 1
No new posts IMS Message : DFS3577A IMS DB/DC 4
No new posts REXX to send an email in Mainframe wi... CLIST & REXX 3
No new posts REXX to send an email in Mainframe CLIST & REXX 4
No new posts dsnrexx fails without error message CLIST & REXX 9
Search our Forums:

Back to Top