View previous topic :: View next topic |
Author |
Message |
rem86 Beginner
Joined: 15 May 2011 Posts: 6 Topics: 1
|
Posted: Fri Nov 11, 2011 1:41 am Post subject: Sending Email thru JCL wid PS file contents as body of email |
|
|
Hi,
Is it possible to send contents of PS as the body of the email, when sending email thru JCL?.
Would appreciate if somebody could guide me on this. _________________ thanks
rem86 |
|
Back to top |
|
|
Anuj Dhawan Intermediate
Joined: 19 Jul 2007 Posts: 298 Topics: 7 Location: Mumbai,India
|
Posted: Fri Nov 11, 2011 2:44 am Post subject: |
|
|
Apart from serching this Forum, have a look here too - this page has a lot of good details. _________________ Regards,
Anuj |
|
Back to top |
|
|
rem86 Beginner
Joined: 15 May 2011 Posts: 6 Topics: 1
|
Posted: Fri Nov 11, 2011 3:30 am Post subject: |
|
|
Thanx Anuj, but that page you asked me to look into contains details on how to send attachments. I need to send the content of a file as the body of an email. _________________ thanks
rem86 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
rem86 Beginner
Joined: 15 May 2011 Posts: 6 Topics: 1
|
Posted: Mon Nov 14, 2011 12:56 am Post subject: |
|
|
Kolusu,
I do not want to sent my file as an attachment, instead I need the file contents to be the body of my email. _________________ thanks
rem86 |
|
Back to top |
|
|
expat Intermediate
Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Mon Nov 14, 2011 8:14 am Post subject: |
|
|
Any particular reason why you want to do it this way when using an attchment is so easily achieved. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
|
taltyman JCL Forum Moderator
Joined: 02 Dec 2002 Posts: 310 Topics: 8 Location: Texas
|
Posted: Mon Nov 14, 2011 9:24 am Post subject: |
|
|
good grief, surely if you can send an attachment the you can send it as a non-attachment. Here's a snippet of code I use.
"alloc fi(mailtext) da('"dsn"') shr"
'alloc fi(smtpout) sysout(b) writer(smtp)'
"newstack"
queue 'HELO XXXXXXX'
queue 'MAIL FROM:<'sndr'>'
queue 'RCPT TO:<'recpt'>'
queue 'DATA'
queue 'FROM: 'sndr' <'sndr'>'
queue 'TO: <'recpt'>'
queue 'SUBJECT: 'subject
queue ' '
"execio * diskr mailtext (finis"
queue '.'
queue 'quit'
say '***'
"execio * diskw smtpout (finis" |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Mon Nov 14, 2011 11:36 am Post subject: |
|
|
rem86 wrote: | Kolusu,
I do not want to sent my file as an attachment, instead I need the file contents to be the body of my email. |
It is a simple change . Try this
Code: |
//STEP0100 EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(A,SMTP)
//SYSUT1 DD *
HELO SYSA
MAIL FROM:<KOLUSU@MVSFORUMS.COM>
RCPT TO:<REM86@DOMAIN.COM>
DATA
FROM: <KOLUSU@MVSFORUMS.COM>
TO: REM86@DOMAIN.COM
SUBJECT: Test message from MAINFRAME
BLAH BLAH BLAH MESSAGE
quit
//* |
Kolusu |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Mon Nov 14, 2011 3:57 pm Post subject: |
|
|
Didn't you get a sufficient answer in the other forum? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Nov 14, 2011 10:55 pm Post subject: |
|
|
Hi Nic,
Some people are just that inconsiderate that they will waste people's time anywhere they can get permission to post.
They also do not seem to realize that the people providing help are largely the same across several forums. . .
Later,
di |
|
Back to top |
|
|
rem86 Beginner
Joined: 15 May 2011 Posts: 6 Topics: 1
|
Posted: Fri Nov 18, 2011 4:38 am Post subject: |
|
|
Kolusu,
In your code the part where "BLAH BLAH BLAH MESSAGE " is given I need to print a file's contents. This file that I am talking about is a error report file that is generated on a daily basis. It gives me a statistical report of the jobs that abended in one day. I need to have this as the body of my email. Is it possible do that? _________________ thanks
rem86 |
|
Back to top |
|
|
rem86 Beginner
Joined: 15 May 2011 Posts: 6 Topics: 1
|
Posted: Fri Nov 18, 2011 5:06 am Post subject: |
|
|
Thank you Taltyman... _________________ thanks
rem86 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Fri Nov 18, 2011 12:41 pm Post subject: |
|
|
rem86 wrote: | Kolusu,
In your code the part where "BLAH BLAH BLAH MESSAGE " is given I need to print a file's contents. This file that I am talking about is a error report file that is generated on a daily basis. It gives me a statistical report of the jobs that abended in one day. I need to have this as the body of my email. Is it possible do that? |
rem86,
*sigh* Are you aware of the concatenation concept in JCL?
Assuming that the report you generated is also having RECFM=FB and LRECL=80 you can change the SYSUT1 to the following
Code: |
//SYSUT1 DD *
HELO SYSA
MAIL FROM:<KOLUSU@MVSFORUMS.COM>
RCPT TO:<REM86@DOMAIN.COM>
DATA
FROM: <KOLUSU@MVSFORUMS.COM>
TO: REM86@DOMAIN.COM
SUBJECT: Test message from MAINFRAME
// DD DSN=Your Report file,DISP=SHR
// DD *
quit |
Kolusu |
|
Back to top |
|
|
Anuj Dhawan Intermediate
Joined: 19 Jul 2007 Posts: 298 Topics: 7 Location: Mumbai,India
|
Posted: Mon Nov 21, 2011 1:57 am Post subject: |
|
|
rem86, It'd be good if you share what you've done and what do you get out of it? You've been pretty much spoon-feeded so far. _________________ Regards,
Anuj |
|
Back to top |
|
|
rem86 Beginner
Joined: 15 May 2011 Posts: 6 Topics: 1
|
Posted: Mon Nov 21, 2011 2:06 am Post subject: |
|
|
Thanks a lot Kolusu, it worked .. _________________ thanks
rem86 |
|
Back to top |
|
|
|
|