DATA Step, Macro, Functions and more

Import File Error

Reply
Occasional Contributor
Posts: 17

Import File Error

[ Edited ]

hi this is vinod 

proc import out=work.superstore1 datafile="C:\Users\user\Desktop\m\sample.xlsx"
dbms=excel replace;
run;

i am getting 

 

ERROR: Unable to open file C:\Users\user\Desktop\m\sample.xls. It does not exist or it is already
opened exclusively by another user, or you need permission to view its data.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.05 seconds

 

plz tell me the answer is this correct

Super User
Posts: 17,912

Re: BASE SAS

The path to the file is incorrect. 

 

If you right click the file holding down SHIFT key you can copy the path to the file directly (COPY AS PATH) and use that in your import. Make sure the file isn't in use either as indicated, ie Excel is closed. 

Super User
Posts: 17,912

Re: Import File Error

Also use DBMS = XLSX not EXCEL. 

Super User
Posts: 10,538

Re: Import File Error

And if you are running in a server environment the path would be from the Server machine point of view and would not see your desktop.

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