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:
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?
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)
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 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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.