BookmarkSubscribeRSS Feed
GeorgeSAS
Lapis Lazuli | Level 10

Hello,

 

I have SAS 9.4 64 bit installed.I want use an excel file in SAS with libname method, but this does not works:

 

 

LIBNAME mylib  "C:\Users\mike\abc.xlsx" ;

 

ERROR: Connect: Class not registered

ERROR: Error in the LIBNAME statement.

 

 

Please help.

 

Thanks!

 

2 REPLIES 2
LinusH
Tourmaline | Level 20
The key is the bitness of your office installation.
There have been a LOT of threads on the communities so I suggest you do a search and return if you still fail to do the connection.
Data never sleeps
Pamela_JSRCC
Quartz | Level 8

We just upgraded to 9.4 64-bits.  This is what I found that works:

 

/* Export */

%let xlsTempFile = &xlsPath.\temp.xlsx;

 

data _null_;

   fileref = 'tempfile';

   rc = filename(fileref, "&xlsTempFile");

   if rc = 0 and fExist(fileref) then

      rc = fDelete(fileref);

run;

 

*For SAS 64-bit ver 9.4;

*libname wkbk pcFiles path="&xlsTempFile"; * This looks good except that Excel cannot read the file;

libname wkbk xlsx "&xlsTempFile"; * This creates a file that Excel can read;

 

data wkbk.data;     * Create destination worksheet "data" within the Excel workbook;

  set sashelp.cars; * Write the dataset into the worksheet;

run;

libname wkbk clear; * Close the workbook;

 

/* Import */

libname wkbk pcFiles path="&xlsPath.\temp.xlsx"; * Open an existing Excel workbook

                                                   using 64-bit SAS ver 9.4;

data temp; * Create new dataset;

  set wkbk.'data$'n; * Read the "data" worksheet into the dataset;

run;

 

libname wkbk clear; * Close the Excel file;

 

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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