BookmarkSubscribeRSS Feed
Ramabc3
Fluorite | Level 6

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

5 REPLIES 5
Kurt_Bremser
Super User

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)

Reeza
Super User

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.

Ramabc3
Fluorite | Level 6

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

Kurt_Bremser
Super User

@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.

eene287
Calcite | Level 5

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!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1323 views
  • 1 like
  • 4 in conversation