DATA Step, Macro, Functions and more

SAS File Import from SAS

Reply
New Contributor
Posts: 3

SAS File Import from SAS

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
Contributor
Posts: 26

Re: SAS File Import from SAS

Posted in reply to Johnsewell22
Hi,
Have you tried importing the file by using the File, import data menu in SAS?
Contributor
Posts: 26

Re: SAS File Import from SAS

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

Super User
Posts: 23,773

Re: SAS File Import from SAS

Posted in reply to Johnsewell22

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. 

Ask a Question
Discussion stats
  • 3 replies
  • 140 views
  • 0 likes
  • 3 in conversation