DATA Step, Macro, Functions and more

Reading xlsx file using libname statement

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Reading xlsx file using libname statement

I'm trying to read a xlsx file using the libname statement.

here is the sample code:

"

libname test1 PCFILES type=excel server = 'servername' port = 8261 path = "c:/test/dfsaa.xlsx";

I did run the proc setinit; It showed sas/access to pc files.

BUt I'm still encountering the error message. plz help me on this


Accepted Solutions
Solution
‎04-18-2012 02:44 PM
Contributor
Posts: 22

Re: Reading xlsx file using libname statement

Issue resolved. I forget to mention the  "path = " in the code

View solution in original post


All Replies
Super User
Posts: 9,687

Re: Reading xlsx file using libname statement

What is your EORROR log ?

Sure. You can use this error message to search at  support.sas.com   and find an answer.

Ksharp

SAS Super FREQ
Posts: 8,743

Re: Reading xlsx file using libname statement

Hi:

  Usually, you only need SERVERNAME and PORT options if, for example, you are on a UNIX system and are trying to access an Excel file on a Windows system. As Ksharp suggests, if you put the text of your error message into the search box on support.sas.com, you will most likely find a SAS Tech Support note that explains about the error message. For example, if you only have SAS 9.1.3 on your system, you will not be able to read .XLSX files with the LIBNAME engine, you would find out about this and other possible errors such as the ones listed here: (not an exhaustive list -- I just pasted a few links):

http://support.sas.com/kb/32/455.html

http://support.sas.com/kb/12/365.html

http://support.sas.com/kb/42/981.html

So your error message could be related to that. Or, since you didn't post the error message, the best thing to do is to go to support.sas.com and on the right side of the page, look for the SEARCH box (it will be orange). Cut and paste your error message into the search box. Alternately, open a track with Tech Support, by clicking on the link "Submit a Problem" on the left side of the support.sas.com main page.

cynthia

Contributor
Posts: 22

Re: Reading xlsx file using libname statement

I'm using sas 9.2 on windows server(64 bit) with sas/access to pcfiles

Here are the error messages I'm encountering:

libname test excel  "test1.xlsx";

Error: The Excel Engine cannot be found

Error:  Error in the libname statement;

so I tried doing this.

libname test pcfiles "test1.xlsx";

Error: Incorrect syntax for the libname statement. This engine doesnt accept a physical name.

Error: Error in the libname statement

Solution
‎04-18-2012 02:44 PM
Contributor
Posts: 22

Re: Reading xlsx file using libname statement

Issue resolved. I forget to mention the  "path = " in the code

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 4357 views
  • 0 likes
  • 3 in conversation