Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Email trigger through JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Email trigger through JCL
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Mon Aug 31, 2015 3:57 pm    Post subject: Reply to: Email trigger through JCL
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Mon Aug 31, 2015 4:34 pm    Post subject: Reply to: Email trigger through JCL
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: 8469
Location: Dubuque, Iowa, USA

PostPosted: Mon Aug 31, 2015 5:43 pm    Post subject:
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    Post subject:
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: 2469
Location: Netherlands, Amstelveen

PostPosted: Mon Aug 31, 2015 7:37 pm    Post subject:
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: 2202
Location: Hampshire, UK

PostPosted: Mon Aug 31, 2015 9:04 pm    Post subject:
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    Post subject:
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: 2469
Location: Netherlands, Amstelveen

PostPosted: Tue Sep 01, 2015 12:27 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Sep 01, 2015 12:35 pm    Post subject: Reply to: Email trigger through JCL
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts EMAIL ADRESS VALIDATION darshansai COBOL Programming 2 Thu Jun 13, 2019 12:40 pm
No new posts Using the SAS module to email mainfra... elixir1986 JCL & VSAM 3 Thu Mar 14, 2019 10:04 pm
No new posts JCL to send email along with formated... wik123 JCL & VSAM 5 Thu Aug 09, 2018 9:48 am
No new posts Need Help on sending email by includi... wik123 JCL & VSAM 9 Mon Jul 30, 2018 2:59 pm
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us