BookmarkSubscribeRSS Feed
Johnsewell22
Calcite | Level 5

I am trying to import a file into SAS.  This is an excel file and I believe my problem is in my filename path, but I do not know how to correct this.  Can anyone help me?  I am going to copy and paste my code and error message.

 

PROC IMPORT OUT= WORK.B6
DATAFILE= "C:\Users\yakit\OneDrive\Documents\STAT 672 DATA SETS\Data Set B6.xlsx" 
DBMS=xlsx REPLACE;
GETNAMES=YES;
DATAROW=2; 
RUN;

 

Here is my error message:

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 PROC IMPORT OUT= WORK.yourfile
63 DATAFILE= "C:\Users\yakit\OneDrive\Documents\STAT 672 DATA SETS\Data Set B6.xlsx"
64 DBMS=xlsx REPLACE;
65 GETNAMES=YES;
66 DATAROW=2;
67 RUN;
 
ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:\Users\yakit\OneDrive\Documents\STAT 672 DATA
SETS\/Data Set B6.xlsx.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
 
68
69 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
82
3 REPLIES 3
marcel
Obsidian | Level 7
Hi,
Have you tried importing the file by using the File, import data menu in SAS?
marcel
Obsidian | Level 7

better yet, save your table as a "csv" (comma delimited) file in excel and import it to sas. It works fine.

Reeza
Super User

Your issue is the path. You're trying to access your local data but it appears SAS is running on a server. 

You can likely use the GUI tools to import or you need to move your file to the server. Or you need to explain your set up in more detail and we can offer alternatives. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

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
  • 3 replies
  • 767 views
  • 0 likes
  • 3 in conversation