BookmarkSubscribeRSS Feed
luke_kading
Calcite | Level 5


I'm getting an error when trying to send an email through the program editor. I am using SAS EG 7.12, connected to the local server.  My error says "An error occurred executing the workspace job - The server is disconnected." Here is my code:

 

filename MYEMAIL email "luke.kading@business.com"
 subject="Paper Data Entry Sheets Dates" 
 from= "luke.kading@business.com"
 to="luke.kading@business.com"
;

data _null_;
 file MYEMAIL;
 put "Here are the last updated dates for the paper files:";
 put "Consumer: &consumer_last_updated.";

run;

 

My program is reading in six different Excel files via proc import.  Then, I am checking the dates of those files and comparing them to what I am expecting the date to be, to ensure the people responsible for entering the Excel sheets actually did their job without having to go into each file to look.  Then, if any date is not what I'm expecting, I want my program to email me and inform me of the different dates (which are macro values) and abort the rest of the program. This program runs entirely on the local server within SAS EG.

 

Everything works great, except for the email portion.  When I run that email syntax after all the steps I just mentioned, I get the error I mentioned above.  However, if I were to run that syntax all by itself without importing my files first, it works fine (other than asking for me to allow the email, but I think that's a security thing I can fix with our IT).  After doing some research, I'm thinking it has to do with either my work library and/or my log getting too full after those six imports, and that's why it fails.

 

Any thoughts on what I can do to fix this?  I've tried clearing out my work library and log before running the email step, but it still doesn't work.  If I can get this to work like I am intending, it can turn a slightly manual process to be fully automated.

 

Thanks

3 REPLIES 3
r_behata
Barite | Level 11

Have you checked if your code or any global option that Abends the session in case of an error ?

 

proc options option=errorabend;
run;

By default the log should reflect this :

 

NOERRORABEND Do not abend on error conditions

 

Is this is not true then try this option and re-run your code.

 

options noerrorabend;

Your email syntax appears to be fine, perhaps you may need to work with your IT to ensure the SMTP ports are enabled on the Server.

 

 

 

 

luke_kading
Calcite | Level 5

Thanks for the suggestion.  I tried the "options noerrabend;" statement and it didn't seem to help. 

 

I don't think this in an IT issue, because when I run the syntax alone without importing my Excel files, it works.  Also, if I run it after I get the error message of disconnecting from the server, it works then as well.  It just doesn't recognize my macro.

 

 

 

CaseySmith
SAS Employee

So you confirmed your errorabend option is set to NOERRORABEND (example log output below) and you still see the same "the server is disconnected" problem?

24 proc options option=errorabend;
25 run;

SAS (r) Proprietary Software Release 9.4 TS1M5

NOERRORABEND Does not end SAS for most errors, issues an error message, sets OBS=0, and goes into syntax check mode.


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 5572 views
  • 2 likes
  • 3 in conversation