IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

SAS SMTP connect issue.


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Nov 20, 2008 9:31 pm
Reply with quote

Hi,

I have trouble finding the name of the SMTP server address in our shop.
Is there any way to find out the SMTP address.? icon_eek.gif

For sending emails, we use IEBGENER and copy the below content to SMTP and this works fine. icon_biggrin.gif

Code:
HELO TMVSK.TSL                                         
MAIL FROM:<MAINFRAME@TO.COM>                       
RCPT TO:<VASANTH.SHANMUGAM@UK.TO.COM>               
DATA                                                   
SUBJECT: ERROR !! YOUR ATTENTION IS REQUIRED...!!!!   
TO: <VASANTH.SHANMUGAM@UK.TO.COM>                   
                                                       
MIME-VERSION: 1.0;                                     
Content-Type: Text;                                   
                                                       
hi how are u                                           
.                                                     
QUIT   




Could you pls say, is TMVSK.TSL the SMTP address? icon_question.gif

Now for the next part,
I assumed that TMVSK.TSL is the SMTP address and used it in below SAS program to send a email,

Code:
//GLDSASAS EXEC SAS820,COND=(4,LT),OPTIONS='EMAILHOST=TMVSK.TSL'
//SAS.WORK DD DSN=&&SASWORK,DISP=(NEW,PASS),UNIT=TEMP,         
//         DCB=(LRECL=27648,BLKSIZE=27648,RECFM=FS),           
//         SPACE=(CYL,(8,10))                                   
//CODE     DD DSN=XK89.DREAM.CNTL,DISP=SHR                     
//SYSIN    DD *                                                 
OPTIONS BUFNO=35 FULLSTIMER ;                                   
%INCLUDE CODE(ATTACK);                                         
/*   




But his comes up with the error icon_mad.gif as

Code:
ERROR: Unable to connect to SMTP server.                         
ERROR: Unable to connect to SMTP server.                         
ERROR: Unable to connect to SMTP server.                         
ERROR: inet_addr failed, cannot convert address 'localhost'.     
ERROR: inet_addr failed, cannot convert address 'localhost'.     
ERROR: inet_addr failed, cannot convert address 'localhost'.




Could you please suggest a technique to find the default SMTP address. icon_sad.gif
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Nov 20, 2008 9:46 pm
Reply with quote

No guarantee on this, but it might be worth a shot.

Look at your SMTP started task. Look at the OUTPUT DD. Look down for the message "EZA5645I IP Mailer Name : smtp.something..."

On my system, the value for the IP Mailer Name IS the domain name of our MS Exchange Server. SMTP is usually reserved to port 25.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Nov 20, 2008 11:51 pm
Reply with quote

What do you get when you run without the EMAILHOST= option? The HELO name tends to be a red herring -- it can pretty much be anything you want and the email will go through, at least on z/OS systems. You need to look at the SMTP or TCPIP started task to get the actual IP address and name.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Nov 21, 2008 1:53 pm
Reply with quote

Hi,

Thanks for your time in this. icon_biggrin.gif

Superk,
I used only IEBGENER so cannot find EZA5645I in JES2 JOBLOG.
Any other techniques available? icon_question.gif

Code:
//XK89COPY JOB 1,'RESTARTS',CLASS=2,MSGCLASS=P,NOTIFY=XK89   
//EMAIL01  EXEC PGM=IEBGENER                                 
//SYSPRINT DD SYSOUT=*                                       
//SYSUT1   DD DSN=XK89.DREAM.CNTL(MAILTEXT),DISP=SHR         
//SYSUT2   DD SYSOUT=(B,TCPSMTP)                             
//SYSIN    DD *   




Robert,

I removed the EMAILHOST option, but the result is the same.
"Unable to connect" icon_sad.gif

and the HELO TMVSK.TSL seems to be some sort of address, cos I removed it and submitted the job, but I did not receive the mail. icon_eek.gif


Quote:
You need to look at the SMTP or TCPIP started task to get the actual IP address and name.


Could you please advice how to view the tasks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Nov 21, 2008 5:52 pm
Reply with quote

You should be able to use whatever package (SDSF, EJES, etc) is used at your site to look at job output; I can't tell you which to use since I don't know your site.

I just noticed you're running SAS 8.2; this is an older release of SAS and I haven't used it in several years. I do know the email component wasn't as good as SAS 9; you need to contact your site SAS support person and discuss your needs with that person. If set up correctly, the site support person probably shows up at the top of the SAS log for every SAS job run.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Nov 21, 2008 7:21 pm
Reply with quote

Hi Robert,

I tried the same program in SAS9.12
but unfortunately I get the same error. icon_sad.gif

I will try to make frens with the SYSPROGS and ask them.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Nov 21, 2008 8:50 pm
Reply with quote

Have you tried using ODS to output the email? The 9.1 ODS manual tells how to do this -- or if needed I believe I have an example of doing it that I can pull off my mainframe at some point.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Nov 21, 2008 8:59 pm
Reply with quote

Hi Robert,

Thanks again for your time in this.

yes I am using SAS ODS to send the Email.

I got the template from

www2.sas.com/proceedings/sugi29/039-29.pdf

Kindly post your example, I believe it will be helpful.


Thanks & Regards,
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Apr 06, 2009 4:11 pm
Reply with quote

Hello Vasanthz,

Did you get the sol. using SAS...?? If so can you please share that with me.. I was also receiving the same error...
Code:

inet_addr failed, cannot convert address 'MU001.MT1SMTP'


I have tried the below SAS options...
Code:

OPTIONS='EMAILSYS=SMTP EMAILHOST=MU001.MT1SMTP'
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Apr 06, 2009 4:49 pm
Reply with quote

Hi,

I was unable to determine the solution as it was something to deal with the software installation setting and I think firewall.. Not sure.

But we have a work around for this ....

Just add an SMTP step below the report generation step.

Example:

Code:
//GLDSASAS EXEC SAS,COND=(4,LT),OPTIONS='BUFNO=40,SVC11SCREEN'
//SAS.WORK DD DSN=&&SASWORK,DISP=(NEW,PASS),UNIT=TEMP,         
//         DCB=(LRECL=27648,BLKSIZE=27648,RECFM=FS),           
//         SPACE=(CYL,(8,10))                                 
//CODE     DD DSN=XK89.BORED.PROGRAMR,DISP=SHR                 
//SYSIN    DD *                                               
OPTIONS BUFNO=35 FULLSTIMER ;                                 
%INCLUDE CODE(SEETHIS);                                       
/*                                                             
//MAILSTEP EXEC PGM=IEBGENER,COND=(4,LT)                       
//SYSPRINT DD SYSOUT=*                                         
//SYSUT1   DD DSN=XK89.SUPER.HEADER4,DISP=SHR                 
//         DD DSN=XK89.HT,DISP=SHR                             
//SYSUT2   DD SYSOUT=(B,TCPSMTP)                               
//SYSIN    DD *                                               
/* 




The GLDSASAS step generates the report using ODS and outputs in watever format u like RTF or HTML into xk89.HT.


The MAILSTEP then sends this report.

The contents of XK89.SUPER.HEADER4 is


Code:
HELO TMVSC.TSL                                       
MAIL FROM:<MAINFRAME@XXXXX.COM>                     
RCPT TO: <VASANTH.SHANMUGAM@UK.XXXXX.COM>           
DATA                                                 
FROM:     MAINFRAME                                 
TO:       UNDISCLOSED                               
SUBJECT: EOD TIMINGS OF ALL DEPOTS                   
MIME-VERSION: 1.0;                                   
CONTENT-TYPE: TEXT/RICH TEXT;                       
CONTENT-DISPOSITION: ATTACHMENT; FILENAME=TIMINGS.DOC


tontodain we have an ods report sent to email.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Apr 06, 2009 4:54 pm
Reply with quote

Hi,

On the other hand I think the address u have given is incorrect. Since it was unable to resolve the IP of the address u provided.

Example,


If we communicate with any server, its IP will be automatically resolved,
like this (PC ping using CMD) automatically.


Code:
P:\>ping Use [URL] BBCode for External Links

Pinging Use [URL] BBCode for External Links [209.85.227.147] with 32 bytes of data:
Back to top
View user's profile Send private message
rajesh1183

New User


Joined: 07 Jan 2008
Posts: 98
Location: Hyderabad

PostPosted: Mon Apr 06, 2009 5:02 pm
Reply with quote

Well, The SMTP server which I was using in SAS options is used in sending E-Mails using the program IKJEFT01. It's working fine in PROD. When I tried the same SMTP server using SAS pgm, it failed...

Is there any command that lists the available SMTP servers that are availble in the mainframe...??
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Apr 06, 2009 6:17 pm
Reply with quote

You may have to contact your site support group for help. The name is from the TCP/IP parameter file that is pointed to by DD name SYSTCPD in the TCP/IP job. There will be a HOSTNAME field and DOMAINORIGIN field. <hostname>.<domainorigin> is the desired server name -- at least it works on my system.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Mon Apr 06, 2009 6:25 pm
Reply with quote

Yep, same here. A SYSTCPD DD statement has to be included in the JCL.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Dec 16, 2009 8:11 pm
Reply with quote

Hi,

After 8 months, finally there is a solution for this icon_biggrin.gif
The trouble was finding the SMTP server address.
Similar to what Robert has mentioned,
Quote:
SYSTCPD in the TCP/IP job

The server address was located in a job called TCPSMTP at our shop.
The job has DD name as //CONFIG & inside the //config DSN there is a IP address something like MAILER 128.2.*.**.
So this is the SMTP address icon_biggrin.gif


Code:
//BORED    EXEC SAS,OPTIONS='EMAILHOST=128.*.*.**'       
//SAS.WORK DD DSN=&&SASWORK,DISP=(NEW,PASS),UNIT=TEMP,   
//         DCB=(LRECL=27648,BLKSIZE=27648,RECFM=FS),     
//         SPACE=(CYL,(8,1))                             
//SYSIN    DD *                                           
FILENAME SEND EMAIL                                       
FROM = 'VASANTH@T***.COM'                               
TO = 'VASANTH.SHANMUGAM@UK.T****.COM'                     
SUBJECT = 'CHARGES REPORT'                               
ATTACH = ('XK89.BORED.PROGRAMR(T***)' EXT='JPG');       
DATA _NULL_;                                             
FILE SEND;                                               
PUT 'PLEASE RECEIVE THE ATTACHED REPORT.';               
RUN;                                                     
/* 
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 16, 2009 11:04 pm
Reply with quote

Hi Vasanth,

Thank you for the followup icon_smile.gif

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Connect Direct 6.3 for Z/OS All Other Mainframe Topics 20
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts Facing ABM3 issue! CICS 3
No new posts Panvalet - 9 Character name - Issue c... CA Products 6
Search our Forums:

Back to Top