Desktop productivity for business analysts and programmers

ERROR: Error opening attachment file

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 17
Accepted Solution

ERROR: Error opening attachment file

Hi,

 

I'm trying to send an email with attachment via SAS, but it seems not to recognize the local route of the file. Everytime I try to send it, I get the error: 

 

ERROR: Error opening attachment file C:\SASDATA\DATA.csv.
ERROR: Physical file does not exist, /sas/sasconfig/Lev1/SASApp/C:\SASDATA\DATA.csv.

 

The code is:

 

FILENAME MailBox EMAIL ATTACH='C:\SASDATA\DATA.csv'

to= ('ch@hotmail.com')
type='text/html'
subject= 'TEST'
from='DE@hotmail.com';

data _null_;
file MailBox;
put 'FILE ATTACHED';
run;

 

Please help.


Accepted Solutions
Solution
‎02-06-2018 10:52 AM
Super User
Posts: 9,569

Re: ERROR: Error opening attachment file

Posted in reply to rodrichiez

Enterprise Guide is just a frontend for a so-called workspace server, which is the actual SAS process that does all the work. In your case, this workspace server runs on a remote UNIX server. To include a file as an attachment in mail directly out of SAS code, the file needs to reside in the UNIX server, or on a shared network resource visible from the server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Solution
‎02-06-2018 10:52 AM
Super User
Posts: 9,569

Re: ERROR: Error opening attachment file

Posted in reply to rodrichiez

Enterprise Guide is just a frontend for a so-called workspace server, which is the actual SAS process that does all the work. In your case, this workspace server runs on a remote UNIX server. To include a file as an attachment in mail directly out of SAS code, the file needs to reside in the UNIX server, or on a shared network resource visible from the server.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 162 views
  • 1 like
  • 2 in conversation