BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

I want to send an email from SAS and attach a file.

I receive an error

 

ERROR: Error opening attachment file \\path\Report.xlsx.
ERROR: Physical file does not exist, \\path\Report.xlsx.

 

I check and the path is correct so I cannot understand what is the problem.

How can I check if the problem is with my authorization?

 

data _null_;
file sendit email
from="XXX@gmail.com"
to=("YYY@gmail.com")
subject="Important Document"
importance="High"
attach=("\\path\Report.xlsx");
put "Please find attached the file";
put;
put "Thanks!";
run;
5 REPLIES 5
Jagadishkatam
Amethyst | Level 16

Could you please check the path again. I believe this is not the correct path, could you share the screenshot of the actual path

 

\\path\Report.xlsx

 

Thanks,
Jag
Ronein
Meteorite | Level 14

The path is 100% correct.

I changed it in the post because I cannot write path of my work

 

 

Patrick
Opal | Level 21

@Ronein 

Can you read anything from this path via a "normal" libname or filename statement?

Have you by any chance the Excel opened via another application (i.e. via a local MS Excel)?

Ronein
Meteorite | Level 14

Hello

Excel file is not opened

Path is correct (If I go to start and paste the path then i can see the excel file)

 

 

Patrick
Opal | Level 21

@Ronein wrote:

Hello

Excel file is not opened

Path is correct (If I go to start and paste the path then i can see the excel file)

 

 


I assume you can see the path from your local machine. If SAS isn't installed on your local machine then this doesn't tell you if this path is also correct on the machine where SAS executes - that's why I've asked you if you're able to execute any filename or libname statement using this path. Just try: libname test '\\path'; This will already tell you if the path as such is accessible from the SAS side.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 875 views
  • 0 likes
  • 3 in conversation