JCL SMTP Problem



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

JCL SMTP Problem

Postby Aditya Jain » Tue Mar 20, 2012 6:37 pm

Hi,
I am trying to send an email to my official id via JCL
For the sake of the below example lets consider the following
my RACF ID : Z99999
Node name : TTTTTTT
( I obtained the Node name from JES2 job log it was written as "N O D E T T T T T T T". I presumed that the node name would be excluding spaces as "TTTTTTT" )
my official email id : ABC@XYZ.com
Following is the JCL step I am trying to run
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
helo TTTTTTT
mail from: <ABC@XYZ.com>
rcpt to: <ABC@XYZ.com>
data
From: <ABC@XYZ.com>
To: <ABC@XYZ.com>
Subject: Test message from MVS using SMTP
This is a line in the body of the note. :)
Aditya Jain
/*

The above code returns a MAXCC zero but the email is not received. Please help.
I've tried putting my RACF ID instead of < ABC@XYZ.com> too.. still it doesn't work.. Please help
Aditya Jain
 
Posts: 11
Joined: Fri Dec 30, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SMTP Problem

 

Re: JCL SMTP Problem

Postby MrSpock » Tue Mar 20, 2012 7:45 pm

Looks OK to me. Did you check with your site's internal support to make sure SMTP is enabled?
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: JCL SMTP Problem

Postby dick scherrer » Tue Mar 20, 2012 11:50 pm

Hello,

There should be some informational/diagnostic message(s) presented when the job is run.

If you post these, it may help ssomeone help you.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: JCL SMTP Problem

Postby Robert Sample » Wed Mar 21, 2012 2:36 am

SMTP requires an ending record consisting of nothing but a period. Without this record, the data is discarded by SMTP. The job will run, it will return a normal zero code, but the email will never be received -- does that sound familiar? Try this:
//SENDNOTE EXEC PGM=IEBGENER
//SYSIN DD DUMMY
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=(B,SMTP)
//SYSUT1 DD *
helo TTTTTTT
mail from: <ABC@XYZ.com>
rcpt to: <ABC@XYZ.com>
data
From: <ABC@XYZ.com>
To: <ABC@XYZ.com>
Subject: Test message from MVS using SMTP
This is a line in the body of the note. :)
Aditya Jain
.
/*
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: JCL SMTP Problem

Postby Aditya Jain » Wed Mar 21, 2012 7:46 pm

Thanks guys.. Somehow, the code that Robert Sample posted didn't work.. I found some other working code.. it had an OUTPUT statement with a DEST parameter and the SYSUT2 was associated with that OUTPUT statement

like

OUT1 OUTPUT DEST=XXXXX,
USERDATA = ('TO:ABC@XYZ.com',
'SUBJECT:TEST')
SYSUT2 DD SYSOUT=(I),OUTPUT=(*.out1)

I searched for the above statements on the internet.. found some info too but couldn't understand a word.. Please explain the above statements
Aditya Jain
 
Posts: 11
Joined: Fri Dec 30, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SMTP Problem

Postby Robert Sample » Wed Mar 21, 2012 8:24 pm

That is not SMTP and your post title clearly indicates SMTP -- which I provided a modification to the JCL you posted that fixed your problem with SMTP. I think you need to stop posting until you know just what it is youre attempting to accomplish and what tool(s) you wish to use.

The OUTPUT statement is part of JES and explained in the JCL Language Reference manual, and it is obvious that you need to contact someone working AT YOUR SITE to find out the various parameters being used at your site. For example, the JCL Language Reference manual states for the USERDATA option of the OUTPUT statement:
22.70 USERDATA Parameter


Parameter Type

Keyword, optional

Purpose

The purpose and use of this keyword is defined by the installation. Refer to your installation's definition on the intent and use of this keyword.
Where the quote refers to "installation" -- read YOUR SITE.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: JCL SMTP Problem

Postby Aditya Jain » Sat Mar 24, 2012 11:14 am

Yes, its my fault.. I didn't mention what exactly I was trying to achieve.. I was trying to send an email via JCL.. that should've been my post title.. Also the line, "Somehow, the code that Robert Sample posted didn't work" should've been "Unfortunately, the code that Robert Sample posted didn't work which I guess is due to my site's installation.".. Also, the ending period for SMTP, this info is missing across various websites..

Thank you Robert for your invaluable contribution.. :)

Thanks MrSpock

Thanks dick scherrer
Aditya Jain
 
Posts: 11
Joined: Fri Dec 30, 2011 8:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: JCL SMTP Problem

Postby Robert Sample » Sat Mar 24, 2012 6:27 pm

Google rfc smtp and find RFC 2821, which is the official specification for SMTP. If you read it, and I have, you'll find -- on page 17/18 -- these words:
Since the mail data is sent on the transmission channel, the end of
mail data must be indicated so that the command and reply dialog can
be resumed. SMTP indicates the end of the mail data by sending a
line containing only a "." (period or full stop). A transparency
procedure is used to prevent this from interfering with the user's
text (see section 4.5.2).

The end of mail data indicator also confirms the mail transaction and
tells the SMTP server to now process the stored recipients and mail
data. If accepted, the SMTP server returns a 250 OK reply.
So whatever web sites you were looking at are not official; it's not surprising they are misleading or wrong because they don't tell you about the line with the period. And there are a number of other RFC specifications that can be handy to know about.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post