- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Try other engine, or check the status of your pc files server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I assume this is why I do a manual import, it converts to csv first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@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.