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

I'm trying to import an Excel file but receive the following error:

 

ERROR: Connect: Class not registered

ERROR: Error in the LIBNAME statement.

ERROR: Database error. Examine fields and/or messages below.

The file specified is not an Excel 4, 5, or 7 (Excel 95) file.

ERROR: Database table must be entered first

ERROR: Database table must be entered first

ERROR: File WORK._IMEX_.DATA does not exist.

 

This is the code I used:

PROC IMPORT OUT= data 

DATAFILE= "directory\filename.xls"

DBMS=EXCEL REPLACE;

RANGE="Sheet$";

GETNAMES=YES;

MIXED=YES;

SCANTEXT=YES;

USEDATE=YES;

SCANTIME=YES;

RUN;

 

Any suggestions on what it could be?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
kath_sven
Calcite | Level 5

thank you everyone for your replies! The problem was fixed after going back to Office 2016 instead of Office 365. I don't know the reason but apparently Office 365 creates problems when importing files.

View solution in original post

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

does your Excel file have xls or xlsx?

 

Reeza
Super User

Is this a new issue?

Have you been able to import an Excel file before?

 

Can you please check your licensing and see if you have SAS Access to PCFILES which is what allows you import Excel files. If you do not have this module licensed I do not believe you can import an Excel file, or at least not easily. If this is the case there are a few workarounds.

 

proc product_status;run;

proc setinit;run;

@kath_sven wrote:

I'm trying to import an Excel file but receive the following error:

 

ERROR: Connect: Class not registered

ERROR: Error in the LIBNAME statement.

ERROR: Database error. Examine fields and/or messages below.

The file specified is not an Excel 4, 5, or 7 (Excel 95) file.

ERROR: Database table must be entered first

ERROR: Database table must be entered first

ERROR: File WORK._IMEX_.DATA does not exist.

 

This is the code I used:

PROC IMPORT OUT= data 

DATAFILE= "directory\filename.xls"

DBMS=EXCEL REPLACE;

RANGE="Sheet$";

GETNAMES=YES;

MIXED=YES;

SCANTEXT=YES;

USEDATE=YES;

SCANTIME=YES;

RUN;

 

Any suggestions on what it could be?

 

Thank you!


 

r_behata
Barite | Level 11

What is the version of your excel ?

 

if it is a latest version (2010 or above) try saving it as .xlsx, change the option to  dbms=xlsx  and run import.

kath_sven
Calcite | Level 5

thank you everyone for your replies! The problem was fixed after going back to Office 2016 instead of Office 365. I don't know the reason but apparently Office 365 creates problems when importing files.

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 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 5788 views
  • 2 likes
  • 4 in conversation