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

Email trigger through JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Madhusudhan Prahlad

New User


Joined: 31 Aug 2015
Posts: 6
Location: India

PostPosted: Mon Aug 31, 2015 3:43 pm
Reply with quote

Hi I want to trigger an email using JCL. the content of a PS file should be emailed to the group id. Please note that the content should be in the message body of the mail. I do not want to use as an attachment. Could you please help me with this.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 31, 2015 3:57 pm
Reply with quote

What do you want to trigger it with? There are lots of examples of sending emails as far as the basic mechanics are concerned.
Back to top
View user's profile Send private message
Madhusudhan Prahlad

New User


Joined: 31 Aug 2015
Posts: 6
Location: India

PostPosted: Mon Aug 31, 2015 4:12 pm
Reply with quote

I have a report in a PS file say date and the record count like a tabular form. I need to send the report via email. The report should be in the body of the message but not as an attachment.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 31, 2015 4:34 pm
Reply with quote

So you add an email step at the end of the JOB. In the body is simple.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 31, 2015 5:43 pm
Reply with quote

Search this site for SMTP -- there are many examples already out there. However, you need to verify with your site support group that SMTP is running on your site (it is NOT required in z/OS). If SMTP is not running, there MAY be other ways to do an email -- in which case your site support group, again, could help you get a job running to do this.
Back to top
View user's profile Send private message
Madhusudhan Prahlad

New User


Joined: 31 Aug 2015
Posts: 6
Location: India

PostPosted: Mon Aug 31, 2015 5:46 pm
Reply with quote

I have used the below step in the JCL but the mail is not getting triggered.

Code:
//STEP10   EXEC PGM=IEBGENER               
//SYSIN    DD DUMMY                       
//SYSPRINT DD SYSOUT=*                     
//SYSUT2   DD SYSOUT=(9,SMTP)             
//SYSUT1   DD *                           
HELO SYSA                                 
MAIL FROM: <XYZ.COM>
RCPT TO:   <ABC.COM>
DATA                                       
FROM:      <XYZ.COM>
TO:        <ABC.COM>
SUBJECT:  TEST MESSAGE FROM MAINFRAME     
//         DD DSN=TEST.FILE,DISP=SHR 


TEST.FILE is my PS file whihc holds the data.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Mon Aug 31, 2015 7:37 pm
Reply with quote

The last 2 lines in your TEST.FILE should contain :

Code:

.           
QUIT
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Aug 31, 2015 9:04 pm
Reply with quote

When presenting code and data to the forum please use the code tags. I have coded it for you this time but I do not wish to do it again for you so...learn how to do it yourself.
Back to top
View user's profile Send private message
Madhusudhan Prahlad

New User


Joined: 31 Aug 2015
Posts: 6
Location: India

PostPosted: Tue Sep 01, 2015 10:15 am
Reply with quote

I have tried this as well. I am getting cc = 0 but the mail is not getting generated.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Sep 01, 2015 12:27 pm
Reply with quote

Is your sysout class "9" valid for use by SMTP? We, at my company, used "B".
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Sep 01, 2015 12:35 pm
Reply with quote

Put the output of the IEBGENER to plain SYSOUT=. Run the step. Look at the output. Then check you email address(es) and then talk to your technical support to find out where they are going missing.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
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 Problem while sending special charact... JCL & VSAM 4
No new posts How to define transaction that trigge... CICS 3
No new posts TXT2PDF and then SMTP email a PDF JCL & VSAM 4
Search our Forums:

Back to Top