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 🙂
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.