BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Nivi
Calcite | Level 5

I'm on Lesson 6 in SAS Essentials, where I am supposed to export a table into a CSV file.

I've followed the instructions exactly (defined the libname to create the output path) and my code has been verified to match the solution. However, I get an error message in the log saying 'Error: Physical File Does Not Exist.' The problem is, of course, that I am trying to create this file, which is why it doesn't exist. I've added the REPLACE tag to my PROC EXPORT call, but this will only apply once there's an actual file to replace.

 

If I hardcode the exact path

 

outfile="~/EPG194/output/storm_final.csv"

 

it works.

 

(for reference, here's the entire code:

 

proc export data=pg1.storm_final
     outfile="~/EPG194/output/storm_final.csv"
     dbms=csv replace;
run;

)

But using

 

libname outpath "~/EPG194/output";

proc export data=pg1.storm_final
     outfile="&outpath/storm_final.csv"
     dbms=csv replace;
run;

 

gives me an error, pointing to a different path

ERROR: Physical file does not exist, /pbr/biconfig/940/Lev1/SASApp/&outpath/storm_final.csv.

 

Why would there be a discrepancy in which path is being called simply by subbing in a libname call?

1 ACCEPTED SOLUTION

Accepted Solutions
Nivi
Calcite | Level 5

Never mind. I'm a dolt.

 

definition was supposed to be

 

%let outpath=~/EPG194/output;

 

not 

 

libname outpath "~/EPG194/output";

 

Amazing what happens when you pay attention to keywords, syntax, and all the little details. My bad.

View solution in original post

2 REPLIES 2
Nivi
Calcite | Level 5

Never mind. I'm a dolt.

 

definition was supposed to be

 

%let outpath=~/EPG194/output;

 

not 

 

libname outpath "~/EPG194/output";

 

Amazing what happens when you pay attention to keywords, syntax, and all the little details. My bad.

Panagiotis
SAS Employee

No worries! I was in the middle of typing that exact response! I have made that mistake before.

 

Best way to learn is to make a mistake and then fix it. Nice work!

 

- Peter

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

LIBNAME 101

Follow along as SAS technical trainer Dominique Weatherspoon expertly answers all your questions about SAS Libraries.

Find more tutorials on the SAS Users YouTube channel.

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