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!
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.
does your Excel file have xls or xlsx?
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!
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.
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.