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?