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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1300 views
  • 0 likes
  • 4 in conversation