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.
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.
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.
I am getting a similar error....
I kindoff understand your response but how can rectify the problem of "Physical file does not exist"..
My code is :
%let report_file = %sysfunc(pathname(work));
ods pdf file="&report_file/Name_of_file.pdf" pdftoc=1 startpage=yes bookmarklist=hide;
.......proc report portion.............
ods pdf close;
filename mailbox email attach='&report_file/Name_of_file.pdf'
to ='my_email@sas.com'
from='my_email@sas.com'
replyto='my_email@sas.com'
subject='mail file'
;run;
data _null_;
file mailbox;
put "Hi,";
Put "Attached is the Report";
put ;
put "Regards";
run;
I get the error:
ERROR: Error opening attachment file:&report_file/Name_of_file.pdf.
ERROR: Physcial file does not exist, /sasnoapps/prodnoconfig/Lev1/Server1/&report_file/Name_of_File.pdf.
Please help!
The macro processor does not process text inside of single quote characters. Use the double quote character instead like you did earlier in the program.
attach="&report_file/Name_of_file.pdf"
This might have been a simple thing for you ...but you saved me so much more reading..
I am doing this for the first time and had been reading stuff from ..SMTP setup, a few other pdfs... etc to resolve this...
Thanks a tonnnnnnnnnnn 🙂
Any reading material on proc report?
Any material on formatting a ods pdf ?
Thank you 🙂
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.