BookmarkSubscribeRSS Feed
Obsidian | Level 7

My computer has 32bit SAS 9.4 and 32bit MS Office Professional Plus 2010, and am trying to set up a program to automatically email users when it is run. I have two problems:

1. If I have MS Outlook open on my computer while the program is running, I get an error message window in SAS that pops up titled "Outlook Data File" and the message is: 'The file c:\users\......\*.ost' cannot be opened'.

2. If I close MS Outlook before I run the SAS program, it creates the email. However, when I open up MS Outlook, the email is just sitting in my 'outbox' until the program sends/receives. I'd like for the email to automatically be sent without my having to open MS Outlook.

One of my coworkers is able to use the exact same program and does not have either of these problems (the email is created and delivered as soon as the program is run, it does not matter if MS Outlook is open).

We've checked and we have the same settings in Tools->Options->System->communications->email. I am not sure if it matters, but we can't use SMTP, only MS Exchange Server. Has anyone else had this problem? Or can anyone point me in a general direction to figure it out?

This is an example of the code that I am using:

filename outbox email emailsys=mapi

     subject='TEST EMAIL SUBJECT';

data _null_;

file outbox;

     put 'BODY OF TEST EMAIL';




Barite | Level 11

It is part of the email setup within SAS. By default a local SAS installation is connected to the local mail. When you have outlook that is outlook. Microsoft prevented to free use of that attempting to frustrate spammers using malware.  What you are wanting is a direct connection to a mail-provider.
The SMTP protocol (port 25) is well known as the classic home provision. You must have the experience using that you are stuck to do that with you internet-provider. That is because by default there is not authentication/identification to the mail server in the original protocol. It is open.  I said was (history) as it could be now. To use that kind of mailing options you are needing the latest version of SAS as they were behind with this.


SAS(R) 9.4 System Options: Reference, Second Edition (emailhost system option). Check you mail setting have been defined able to send mail with your mail-provider. 

---->-- ja karman --<-----
Quartz | Level 8

With the local versions of SAS, both of you could have different options set either in the config (sasv9.cfg) or in the (if either of you use that).

Im not an exchange expert but I do know that we are able to use SMTP with our exchange server by placing the following option at the beginning of the sasv9.cfg file.

-emaildlg SAS

-emailsys SMTP

-emailhost [your exchange ip address]

-emailport [your exchange port number]

Hope this helps!


Obsidian | Level 7

Thanks for the hints. I couldn't get it to work though, turns out I our 9.4 version is not local. Supposedly someone at my company is working on it...

[unrelated whining] I also can't open a SAS program into the program editor by double-clicking anymore... Apparently it's now a setting that I don't have rights to change... It's the tiny little things like this that make me miserable. I will now release my frustration by typing loudly for a few hours. [end unrelated whining]


Barite | Level 11

I can not offer you a shoulder for the whining.
I understand what has happened. It is the server based approach Eguide and more (you cannot double click).
The nasty question is why you have not a guy you can talk to helping you. A cooperative SAS platform admin also with some "first stept at ..." docs .

---->-- ja karman --<-----
Obsidian | Level 7

Thanks Jaap & Eric, finding out what our SMTP server domain name got around the MAPI problems! Our SAS admin doesn't actually use SAS so I think he is not so familiar with some of the issues (and my whining is not high on his priority list :smileysilly: ).

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 3 in conversation