DATA Step, Macro, Functions and more

Error in Libname statement

Reply
Contributor
Posts: 37

Error in Libname statement

I am trying to access data from excel workbook but I am not able to give a Libname ref, getting the following error.

My code:

LIBNAME mylib excel  "C:\Users\ak26\Desktop\Readme.xls";

 

Error I am getting- 

ERROR: Connect: Class not registered
ERROR: Error in the LIBNAME statement.

 

Please help me out.

I tried to download PC Files server form  http://support.sas.com/downloads/browse.htm?cat=63

but I am not able to download this, is there any alternate way to do this.

 

Thanks!

 

 

PROC Star
Posts: 7,480

Re: Error in Libname statement

[ Edited ]
Posted in reply to LittlesasMaster
Contributor
Posts: 37

Re: Error in Libname statement

No i am on 9.3
Super User
Posts: 19,822

Re: Error in Libname statement

Posted in reply to LittlesasMaster

I thought an earlier version of the XLSX engine was available in SAS 9.3 TS1M3. Definitely for exporting, not sure about importing.

 

If you have this problem solved please mark it as such, otherwise clarify which engines you've tried and haven't worked. 

 

 

PROC Star
Posts: 7,480

Re: Error in Libname statement

[ Edited ]
Posted in reply to LittlesasMaster

Have you tried using proc import with the dbms=xlsx option?

 

Art, CEO, AnalystFinder.com

 

Super User
Posts: 19,822

Re: Error in Libname statement

You have an XLS file, not XLSX. Try some of the older engines such as XLS or Excel2003

Contributor
Posts: 37

Re: Error in Libname statement

Hi Art297,

 

Proc import is working for both xls and xlsx files, 

Actually I have got 12 sheets in my workbook, so I was planning if I can define a libname with excel engine

then I can directly use those sheets (those will apear with $ and sheet name).

 

Thanks!

Dharmendra

Super User
Posts: 3,256

Re: Error in Libname statement

[ Edited ]
Posted in reply to LittlesasMaster

A quick and dirty solution would be to do a FILE SAVE AS in Excel as CSV, then import the resulting CSV file using PROC IMPORT DBMS = CSV.

Contributor
Posts: 37

Re: Error in Libname statement

Hi SAsKiwi,

I have so many sheets, so I would need to run proc import so many times.

Thanks!

 

Super User
Posts: 3,256

Re: Error in Libname statement

Posted in reply to LittlesasMaster

OK, this was just a thought if you couldn't get an Excel LIBNAME working at all.

Super User
Super User
Posts: 7,060

Re: Error in Libname statement

Posted in reply to LittlesasMaster

Trouble with the EXCEL engine is usually a sign that your SAS and Microsoft Office installations are using different number of bits (32 vs 64). Can you get a different installation of either so that they are compatible?

Or just upgrade to SAS 9.4 and use the XLS engine on your LIBNAME statement.  

Note that SAS 9.3 is now over 4 and half years old.

From Rick's blog posting:

http://blogs.sas.com/content/iml/2013/08/02/how-old-is-your-version-of-sas-release-dates-for-sas-sof...

data Releases;
format Date DATE7.;
input Category $13. Release $9. Date DATE9. StatRelease $5.;
datalines;
Ancient      8.0      01Nov1999 
Ancient      8.1      01Jul2000 
Ancient      8.2      01Mar2001 
Ancient      9.0      01Oct2002 
Ancient      9.1      01Dec2003 
Ancient      9.1.3    01Aug2004 
Ancient      9.2      01Mar2008 9.2
Old          9.2m2    01Apr2010 9.22
Old          9.3      12Jul2011 9.3
Old          9.3m2    29Aug2012 12.1
Recent       9.4      10Jul2013 12.3
Recent       9.4m1    15Dec2013 13.1
Recent       9.4m2    05Aug2014 13.2
Recent       9.4m3    14Jul2015 14.1
Recent       9.4m4    16Nov2016 14.2
;

 

Ask a Question
Discussion stats
  • 10 replies
  • 1217 views
  • 0 likes
  • 5 in conversation