Hi
I am trying to import a CSV file, here's the code I used
proc import datafile="\\Mac\Home\Downloads\cars_novname.csv"
out=mydata dbms=csv replace;
getnames=no;
run;
When I execute I get this error message "Physical file does not exist........." import unsuccessful.
The file is very much there in the path.
Thanks
Ramaa
When SAS says "physical file does not exist", then it isn't there, period.
You may have a situation where you can "see" the file from your desktop, but the SAS process on the SAS server can't.
Tell us a little about your SAS setup (servers, operating systems)
Are you using SAS UE? If so, please read the instructions on how to access a CSV file from University Edition.
You have to kind of follow the links to get to the solution but it's buried here:
https://support.sas.com/software/products/university-edition/faq/SAS_accessdata_Excel.htm
In general, place the file in your myfolders created at set up, then navigate to that folder in SAS UE using Server Files & Folders Pane. Then right click the file and under properties it will have the full path.
Hi
Just to clarify ai am not accessing a CSV file fro UE, I pasted the code I found on google.
I tweaked the code to pick the file from Shared drive
Thanks
Ramaa
@Ramabc3 wrote:
Hi
Just to clarify ai am not accessing a CSV file fro UE, I pasted the code I found on google.
I tweaked the code to pick the file from Shared drive
Thanks
Ramaa
Then we need the answer to my previous post.
The way it works 100% in SAS studio, no matter the operating system, is through the "Upload" wizard. The wizard creates a temporary location for the file on your drive, which has the same name as your file, i.e.,
cars_novname.csv
That is not your actual file, but only an importing code.
Copy from that code: the PROC IMPORT
and the PROC CONTENTS
Replace the name "REFFILE" with the path listed under FILENAME in the importing code.
You may want to replace the directory WORK with a permanent location (library) at your choice and the table name IMPORT with a name of your choice, i.e., cars_nov.
Also, check the columns of the created "cars_nov.sas7bdat" to see if all characters and numbers are displayed correctly.
If the format in some columns is not what you want, you can copy and transform the log of the import procedure for generating different formats. A video I found useful for all these steps is https://www.youtube.com/watch?v=unfBvLyyQjs.
Good luck!
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!
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.