BookmarkSubscribeRSS Feed
NickR
Quartz | Level 8
Hello,

I'm using SAS 9.1.3 and I need to import excel 2007 (.xlsx) files into SAS so, I am using SAS/ACCESS interface to ODBC with the Excel 2007 ODBC driver. This method works fine, but it automatically generates variable names from the first row of excel sheet. Is there an option to prevent this (like GETNAMES=NO in proc import)?

My code:

libname myxls odbc required="Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)};
dbq=c:\spreadsheet.xlsx"
access=readonly defer=yes;

data one;
set myxls."data$A9:Z500"n;
run;

thanks for your time!! Message was edited by: Nick R
5 REPLIES 5
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
More the topic, use this Google advanced search argument to find relevant SAS support http://support.sas.com/ topic papers/references.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search arguments, this topic / post:

sas 9.1.3 excel xlsx support site:sas.com

sas 9.1.3 getnames site:sas.com
NickR
Quartz | Level 8
Thanks. I tried searching using Google advanced search argument but no luck so far. Will contact SAS technical support.
NickR
Quartz | Level 8
The link you've provided describes importing .XLS files. I need to import .XLSX (excel 2007) files, without generating variable names from the spreadsheet.
Ksharp
Super User
How about :
[pre]
libname xls excel path='c:\test.xls' header=no;
proc sql;
create table xls as
select * from xls.'Sheet1$'n;
quit;
[/pre]



Ksharp

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
  • 5 replies
  • 2475 views
  • 0 likes
  • 4 in conversation