SAS Office Analytics, SAS Add-In for Microsoft Office, and other integrations

I cannot open excel file son SAS.

Reply
Occasional Contributor
Posts: 5

I cannot open excel file son SAS.

I use the import wizard but when I select the file and click OK I get the error message in my log :

ERROR:Connect: Class not registered

ERROR: Error in the LIBNAME statement.

I am a new user and still getting used to it.

Any idea how to open my files?

Contributor
Posts: 43

Re: I cannot open excel file son SAS.

It's impossible to answer this question without seeing your program code.

Please cut-and-paste the relevent part of the code.

Oh, sorry - you said you were using the import wizard... (I always write my program code, so I would be using a Proc Import statement)

I can't help with that.

Grand Advisor
Posts: 17,360

Re: I cannot open excel file son SAS.

More than likely you're using SAS 64bit and have Excel 32 bit.

Try using the PCFILES or the EXCELCS in the drop down if they're available.

via the libname method it would look like the following:

libname XLS pcfiles path='path_to_excel_file.xlsx';

OR

libname XLS excelcs 'path_to_excel_file.xlsx';

Occasional Contributor
Posts: 5

Re: I cannot open excel file son SAS.

The code I use is:

libname census pcfiles path="C:\Users\mzavalza\Documents\Myriam\Census 2010_ACS data_excel\Cens_ZIP_URBAN AND RURAL.xlsx";

RUN;

And I get this error:

ERROR: Unable to locate pcfserver.exe. Please install PC Files Server.

ERROR: Error in the LIBNAME statement.

But when I check my SAS license like this:

proc setinit;

run;

I get in the log that I have the pc files

---SAS/ACCESS Interface to DB2

         30JUN2015

---SAS/ACCESS Interface to Oracle

         30JUN2015

---SAS/ACCESS Interface to Sybase

         30JUN2015

---SAS/ACCESS Interface to PC Files

         30JUN2015

---SAS/ACCESS Interface to ODBC

         30JUN2015

---SAS/ACCESS Interface to OLE DB

         30JUN2015

---SAS/ACCESS Interface to Teradata

         30JUN2015

---SAS/ACCESS Interface to MySQL

         30JUN2015

I have to use the pc files isnce my SAS version is 64 bit and my excel is 32 bit

Contributor
Posts: 43

Re: I cannot open excel file son SAS.

I remember a co-worker had this problem, and he needed to install "SAS PC Files Server"

This link has the instructions for checking to see if you already have it installed.  (I'm not sure the SAS/Access you checked is the same thing.)

43802 - Installing SAS® 9.3 PC Files Server and using it to convert 32-bit Microsoft Office files to...

Occasional Contributor
Posts: 5

Re: I cannot open excel file son SAS.

When I try the import option and choose the Microsoft Excel Workbook on PC files server this window appears:

what next.jpg

I will sound very dumb but what would the server name be?

cwilson I will check that right now

Thank you

Grand Advisor
Posts: 10,211

Re: I cannot open excel file son SAS.

A machine on your network running the PC Files Server programs.

PC Files as shown in your setinit output is not the same as PC Files Server. Possibly a poor choice of naming on the part of SAS.

Have you tried Libname census excel <etc>?

Occasional Contributor
Posts: 5

Re: I cannot open excel file son SAS.

Yes I've tried that too but doesn't work either with excel or excelcs -.-

When I followed the link for the PC Files Server it says is only fro SAS 9.3 I wonder if it also works for 9.4 which is what I have...

SAS Employee
Posts: 232

Re: I cannot open excel file son SAS.

Hi there.. just wanted you to know I moved this from the "About Communities" space to the "Integrations with Microsoft Office" space here: https://communities.sas.com/community/support-communities/integration_with_microsoft_office

Grand Advisor
Posts: 10,211

Re: I cannot open excel file son SAS.

I suspect you won't be re-reading this type of data on a daily basis. It may well be worth the not very significant effort to save the Excel file as CSV and import that version. One advantage is that SAS will create data step code that you can modify if something is imported in an unexpected manner.

Valued Guide
Posts: 3,206

Re: I cannot open excel file son SAS.

The PC files server is a program to be started on a Windows machine.

That Windows machine is having a DNS name (internet name) and using a port number. Nothing weird as your browser is going to a server using a portnumber (80 or 436).

At what machine are you running the PC files server? It van be your local machine, that it is having also a name.  look at the hosts file C:\Windows\System32\drivers\etc and services you will see localhost as a valid name, otherwise use ipconfig /all showing all of tcp/ip.    

That class not being registered is a common issue having 64-bit SAS or Eguide and using a 32-bit Office, The same bitness clients should be installed. Having a 64-bit SAS-base and 32-bit Offic you can use the 32-bit version of pcfile-server to get arround that. Why using that servername? You can access PC-files sercver also using/running Unix and circumvent the different OS systems with that.. You have to define that port number at the client/libname.

---->-- ja karman --<-----
Occasional Contributor
Posts: 5

Re: I cannot open excel file son SAS.

Hey everyone.

I ended up using this code to make my excel files into SAS files.

PROC IMPORT OUT= WORK.data2 DATAFILE= "C:\data1.xlsx"

            DBMS=xlsx REPLACE;

SHEET="data1";

     GETNAMES=YES;

RUN;


Thank you for all of your help.

Ask a Question
Discussion stats
  • 11 replies
  • 4389 views
  • 2 likes
  • 6 in conversation