View previous topic :: View next topic
|
Author |
Message |
Madhusudhan Prahlad
New User
Joined: 31 Aug 2015 Posts: 6 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Madhusudhan Prahlad
New User
Joined: 31 Aug 2015 Posts: 6 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So you add an email step at the end of the JOB. In the body is simple. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Madhusudhan Prahlad
New User
Joined: 31 Aug 2015 Posts: 6 Location: India
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
The last 2 lines in your TEST.FILE should contain :
|
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
Madhusudhan Prahlad
New User
Joined: 31 Aug 2015 Posts: 6 Location: India
|
|
|
|
I have tried this as well. I am getting cc = 0 but the mail is not getting generated. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Is your sysout class "9" valid for use by SMTP? We, at my company, used "B". |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
|