MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sending Email thru JCL wid PS file contents as body of email
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
rem86
Beginner


Joined: 15 May 2011
Posts: 6
Topics: 1

PostPosted: Fri Nov 11, 2011 1:41 am    Post subject: Sending Email thru JCL wid PS file contents as body of email Reply with quote

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
View user's profile Send private message
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Fri Nov 11, 2011 2:44 am    Post subject: Reply with quote

Apart from serching this Forum, have a look here too - this page has a lot of good details.
_________________
Regards,
Anuj
Back to top
View user's profile Send private message
rem86
Beginner


Joined: 15 May 2011
Posts: 6
Topics: 1

PostPosted: Fri Nov 11, 2011 3:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Fri Nov 11, 2011 11:49 am    Post subject: Reply with quote

rem86,

Please search before posting. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=439&highlight=email+attachment+attachement

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
rem86
Beginner


Joined: 15 May 2011
Posts: 6
Topics: 1

PostPosted: Mon Nov 14, 2011 12:56 am    Post subject: Reply with quote

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
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Mon Nov 14, 2011 8:14 am    Post subject: Reply with quote

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
View user's profile Send private message
taltyman
JCL Forum Moderator
JCL Forum Moderator


Joined: 02 Dec 2002
Posts: 310
Topics: 8
Location: Texas

PostPosted: Mon Nov 14, 2011 9:24 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Mon Nov 14, 2011 11:36 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Mon Nov 14, 2011 3:57 pm    Post subject: Reply with quote

Didn't you get a sufficient answer in the other forum?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Nov 14, 2011 10:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
rem86
Beginner


Joined: 15 May 2011
Posts: 6
Topics: 1

PostPosted: Fri Nov 18, 2011 4:38 am    Post subject: Reply with quote

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
View user's profile Send private message
rem86
Beginner


Joined: 15 May 2011
Posts: 6
Topics: 1

PostPosted: Fri Nov 18, 2011 5:06 am    Post subject: Reply with quote

Thank you Taltyman...
_________________
thanks

rem86
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12358
Topics: 75
Location: San Jose

PostPosted: Fri Nov 18, 2011 12:41 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Anuj Dhawan
Intermediate


Joined: 19 Jul 2007
Posts: 298
Topics: 7
Location: Mumbai,India

PostPosted: Mon Nov 21, 2011 1:57 am    Post subject: Reply with quote

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
View user's profile Send private message
rem86
Beginner


Joined: 15 May 2011
Posts: 6
Topics: 1

PostPosted: Mon Nov 21, 2011 2:06 am    Post subject: Reply with quote

Thanks a lot Kolusu, it worked ..
_________________
thanks

rem86
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group