BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Zatere
Quartz | Level 8

Hi there,

 

I am trying to read excel files in SAS using SAS/ACCESS LIBNAME statement. I have checked the following:

 

  • proc setinit; run; --> I have SAS/ACCESS Interface to PC Files
  • I am running SAS 9.4 with Microsoft Excel 2016

I use the following code:

 

libname results xlsx "C:\Users\My Files\myfile.xlsx";

data work.test;   
set results.'Sheet1'n;
run;

I am getting the following on the SAS Log:

 

331  libname results xlsx "C:\Users\Documents\My Files\myfile.xlsx";
NOTE: Libref RESULTS was successfully assigned as follows:
      Engine:        XLSX
      Physical Name: C:\Users\My Files\myfile.xlsx

And below is the remaining SAS log:

 

347  proc contents data=results._all_;

WARNING: No matching members in directory.
NOTE: PROCEDURE CONTENTS used (Total process time):
      real time           0.05 seconds
      cpu time            0.00 seconds


348  data work.test;
349  set results.'Sheet1'n;
ERROR: Error opening XLSX file -> C:\Users\Documents\My SAS Files\myfile.xlsx .  It is
either not an Excel spreadsheet or it is damaged.   Error code=80001019
Requested Input File Is Invalid
ERROR: File RESULTS.Sheet1.DATA does not exist.
350  run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEST may be incomplete.  When this step was stopped there were 0
         observations and 0 variables.
NOTE: DATA statement used (Total process time):
      real time           0.04 seconds
      cpu time            0.03 seconds

However, the library results is empty. I have looked at the community for a similar issue but could not find anything. 

 

Could you please help on that?

 

Thanks and regards!

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

This is your clue:

ERROR: Error opening XLSX file -> C:\Users\Documents\My SAS Files\myfile.xlsx .  It is
either not an Excel spreadsheet or it is damaged.   Error code=80001019
Requested Input File Is Invalid

The file is not recognized by SAS as a file according to the XLSX format. It might be that someone cheated on you and gave you a classic XLS file with a wrong extension, or something different altogether which is opened by Excel as a spreadsheet (think csv).

 

Or the file is simply still opened (or thinks it is) by Excel, see https://blogs.sas.com/content/sasdummy/2014/09/24/proc-import-xlsx-error/

This link is the first that turns up on a google search for "Error code=80001019", see Maxim 6.

View solution in original post

5 REPLIES 5
Zatere
Quartz | Level 8
Hi, I edited my original post. I am not quite sure about "What are your settings for options validvarname and validmemname?". Thanks
Kurt_Bremser
Super User

This is your clue:

ERROR: Error opening XLSX file -> C:\Users\Documents\My SAS Files\myfile.xlsx .  It is
either not an Excel spreadsheet or it is damaged.   Error code=80001019
Requested Input File Is Invalid

The file is not recognized by SAS as a file according to the XLSX format. It might be that someone cheated on you and gave you a classic XLS file with a wrong extension, or something different altogether which is opened by Excel as a spreadsheet (think csv).

 

Or the file is simply still opened (or thinks it is) by Excel, see https://blogs.sas.com/content/sasdummy/2014/09/24/proc-import-xlsx-error/

This link is the first that turns up on a google search for "Error code=80001019", see Maxim 6.

Zatere
Quartz | Level 8

Yes indeed my file was opened in another application! Thanks a lot!

Kurt_Bremser
Super User

And please don't edit previous posts with new information, as that does not trigger an email notification. Adding a new message to a thread does so automatically.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 5 replies
  • 2133 views
  • 0 likes
  • 2 in conversation