BookmarkSubscribeRSS Feed
jflo36
Calcite | Level 5

Hi, 

I keep getting the error code listed below while importing this excel file into sas. The file name is: pay_file_102115.XLSX

 

ERROR: Unable to open file
pay_file_102115.XLSX. 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.01 seconds
cpu time 0.01 seconds

 

This is the code that I am using to import the file:

PROC IMPORT OUT= WORK.TEST
DATAFILE= "\\pay_file_%sysfunc(date(),mmddyyn6.).XLSX"
DBMS=EXCEL REPLACE;
GETNAMES=YES;
MIXED=NO;
SCANTEXT=YES;
USEDATE=YES;
SCANTIME=YES;
Run;

 

Can someone help please?

4 REPLIES 4
JoshB
Quartz | Level 8

It's hard to say much with limited information. What OS are you operating on? Is it possible that file is truly open somewhere else? I would check that the file does exist in the root directory you're referencing and that the case on the file name is correct, including the extension.

jflo36
Calcite | Level 5

I am using Windows 7. The file is actually from a share network drive.

ballardw
Super User

@jflo36 wrote:

I am using Windows 7. The file is actually from a share network drive.


Then you need to have the Drive indicated along with the path to the file.

ballardw
Super User

I would try two things: One is to use a full path to describe where the file is located. Second, tryit with out any functions or macro variables.

Also, are you running in a server environment? If so the path to the file needs to be as the server sees it.

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