When I try to load a file "test.xls" (97-2003 Workbook) that is generated by Microsoft Excel 2010 SMO 64 bit, using Enterprise Guide 64 bit. The test.xls is a The error message is:
ERROR: Connect: Class not registered
ERROR: Error in the LIBNAME statement
I have tried the following statement and all have the same error
libname refname excel path="C:\workspace\test.xls'';
libname refname "C:\workspace\test.xls";
I also tried to cover 'test.xls' (Excel 97-2003 Workbook) to 'text.xlsx'(Excel Workbook), and the following statement also did not work:
libname refname excel path='C:\workspace\test.xlsx';
libname refname xlsx path='C:\workspace\test.xlsx';
libname refname 'C:\workspace\test.xlsx';
Appreciate any advice!
You have typos in that code:
libname tmp excel 'C:\workspace\test.xlsx';
Take the path= out of it.
Or you can use proc import:
proc import datafile="c:/workspace/test.xlsx" out=want dbms=xlsx replace;
run;
Note that to load XLS files you will need pcfiles server as that is a very old file format and windows only.
You have typos in that code:
libname tmp excel 'C:\workspace\test.xlsx';
Take the path= out of it.
Or you can use proc import:
proc import datafile="c:/workspace/test.xlsx" out=want dbms=xlsx replace;
run;
Note that to load XLS files you will need pcfiles server as that is a very old file format and windows only.
The first option below does not work and still has the same error:
libname tmp excel 'C:\workspace\test.xlsx';
The second option works beautifully:
proc import datafile="c:/workspace/test.xlsx" out=want dbms=xlsx replace; run;<code></code>
My understanding is that I do not need pcfile server, since I have using both 64 bit Excel and 64 bit SAS. The following is from the link of SAS Support,
"If you are running a 64-bit version of Microsoft Office and SAS on 64-bit Microsoft Windows, you do not need to install SAS PC Files Server, except if you plan to connect from a Linux- or UNIX-based SAS installation."
Use the same engine that works in proc import for your libname:
libname tmp xlsx 'C:\workspace\test.xlsx';
PS this was meant to be an answer to a post from @xiliang that has been deleted in the meantime.
Quite true, there are far to many Excel based engines around. Just use a nice open source file format and bin the horrible proprietary stuff for a better future for us all!
@RW9 wrote:
Quite true, there are far to many Excel based engines around. Just use a nice open source file format and bin the horrible proprietary stuff for a better future for us all!
Absolutely. That stuff has proven itself to be a total hellhole for users. I know why I exclusively use LibreOffice for my spreadsheet needs. Has kept the same file format and user interface for more than a decade now. That's why I've been urging SAS every now and then to support OpenOffice/LibreOffice, at least the .ods format.
Thanks! Indeed the error was caused by a typo!
Are you using the Local SAS server? If not, you won't have access to the C: drive of your desktop.
Do you have SAS/ACCESS to PC Files licensed? Run proc setinit and proc product_status to determine that.
I am using my Desktop version of SAS. Does this mean I am using Local SAS server?
I think I have PC Files licensed. Here is the list:
For Base SAS Software ...
Custom version information: 9.4_M5
Image version information: 9.04.01M5P090617
For SAS/STAT ...
Custom version information: 14.3
For SAS/GRAPH ...
Custom version information: 9.4_M5
For SAS/IML ...
Custom version information: 14.3
For SAS/QC ...
Custom version information: 14.3
For High Performance Suite ...
Custom version information: 2.2_M6
For SAS/ACCESS Interface to PC Files ...
Custom version information: 9.4_M5
For SAS/ACCESS Interface to ODBC ...
Are you using the Local SAS server? If not, you won't have access to the C: drive of your desktop.
Do you have SAS/ACCESS to PC Files licensed? Run proc setinit and proc product_status to determine that.
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!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: