Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 7223

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: 7223

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: 7904
Location: Bellevue, IA

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: 2422
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: 1712
Location: 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: 2422
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: 7223

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 Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts How to send email with Rich Text usin... santhosh5983 JCL & VSAM 4 Fri Apr 08, 2016 2:30 am
No new posts How to track incoming input files tha... shreya19 JCL & VSAM 6 Thu Feb 25, 2016 6:15 pm
No new posts Issue in trigger vickey_dw DB2 3 Wed Feb 10, 2016 5:41 pm
No new posts Trigger a mainframe job by mail Praveen Thenraj IBM Tools 8 Wed Jan 13, 2016 12:05 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us