BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Autotelic
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

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)

View solution in original post

5 REPLIES 5
LinusH
Tourmaline | Level 20
Excelcs requires a PC Files Server i think.
Try other engine, or check the status of your pc files server.
Data never sleeps
Autotelic
Obsidian | Level 7
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?
Kurt_Bremser
Super User

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)

Autotelic
Obsidian | Level 7
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.
ballardw
Super User

@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.

 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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