Desktop productivity for business analysts and programmers

Proc import - ERROR: Failed to connect to the Server

Accepted Solution Solved
Reply
Contributor
Posts: 40
Accepted Solution

Proc import - ERROR: Failed to connect to the Server

[ Edited ]

SO: Windows 10

SAS EG: 7.1 (7.100.0.1966) (64-bit) Edit: SAS Base 9.2

 

Proc import out= WORK.auto1 datafile= "path\file_name.xlsx" 
            DBMS=excelcs
            replace;
            sheet="auto"; 
Run;

When trying to execute the above code, I get the error:

ERROR: Failed to connect to the Server: .

I'm not connected on any server:
profile.PNG

The file I'm trying to import was downloaded from this example and my code is based on the code in the link.

 

What's going on? How can I use proc import to import this excel?


Accepted Solutions
Solution
‎10-02-2017 05:49 AM
Super User
Posts: 10,557

Re: Proc import - ERROR: Failed to connect to the Server

Posted in reply to Autotelic

The excelxs engine is meant for access to old (pre-xlsx) files from non-Windows platforms. It needs a "SAS PC Files Server" running on a Windows machine that uses the Windows-only Microsoft-supplied conversion module.

Since you have a local install, you can try to use dbms=xlsx instead (no extra server needed, but SAS 9.4 required)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Super User
Posts: 5,916

Re: Proc import - ERROR: Failed to connect to the Server

Posted in reply to Autotelic
Excelcs requires a PC Files Server i think.
Try other engine, or check the status of your pc files server.
Data never sleeps
Contributor
Posts: 40

Re: Proc import - ERROR: Failed to connect to the Server

Alas I have no idea of what you're talking about. What is another engine? How can I check the status of my pc files server?
Solution
‎10-02-2017 05:49 AM
Super User
Posts: 10,557

Re: Proc import - ERROR: Failed to connect to the Server

Posted in reply to Autotelic

The excelxs engine is meant for access to old (pre-xlsx) files from non-Windows platforms. It needs a "SAS PC Files Server" running on a Windows machine that uses the Windows-only Microsoft-supplied conversion module.

Since you have a local install, you can try to use dbms=xlsx instead (no extra server needed, but SAS 9.4 required)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 40

Re: Proc import - ERROR: Failed to connect to the Server

Posted in reply to KurtBremser
I'm on SAS 9.2 (I just added this information to the post).
I assume this is why I do a manual import, it converts to csv first.
Super User
Posts: 13,922

Re: Proc import - ERROR: Failed to connect to the Server

Posted in reply to Autotelic

Autotelic wrote:
I'm on SAS 9.2 (I just added this information to the post).
I assume this is why I do a manual import, it converts to csv first.

I routinely convert Excel files to CSV prior to reading them with a data step because proc import has to guess about variable types and lengths. In most cases repeated files of supposedly the same the layout and similar content will get changes in lengths of character variables or types of variables when using import causing headaches when combining the data. I head that off by the data step reading a known structure and setting the variable types and lenghths based on the agreed description of the data I should be getting.

 

 

☑ This topic is solved.

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

Discussion stats
  • 5 replies
  • 2389 views
  • 3 likes
  • 4 in conversation