BookmarkSubscribeRSS Feed
BenBrady
Obsidian | Level 7

I have saved a file called cars.xlsx that is saved in a file path called myexcel. The sheet I want to import is called CarData. I am using the following code to import it into sas:

 

 

proc import 
datafile = 'myex\cars.xlsx'
out= Car_Data
dbms = xlsx replace;
sheet = "CarData";
getnames = yes;
run;

 

I am getting an error that says: ERROR: DBMS type XLSX not valid for import. When I chance XLSX to excel I still get the same error message

2 REPLIES 2
ChrisNZ
Tourmaline | Level 20

Please check that xlsx is supported for your SAS version under linux/unix.

ballardw
Super User

Run this code:

proc setinit;
run;

If you do not have something similar to the following  appear in the log then your SAS is not licensing the module to use that approach to importing Excel files:

 

---SAS/ACCESS Interface to PC Files

 

Which would mean either getting license for that module or you could do a file save as from Excel to CSV and import that file as a delimited file. Add the option guessingrows=max to the proc import code to have a better chance at getting good results.

 

 

If you do see that then run this code:

proc product_status;
run;

If you do not see something like the following then it means the module was not installed:

 

For SAS/ACCESS Interface to PC Files ...

Which means that a reinstall paying attention to select the module might help.

 

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 969 views
  • 0 likes
  • 3 in conversation