BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi All

I was just wondering if there is a function or DDE query I can run to find the sheet names within Excel? E.G. Book1.xls contains Sheet1 Sheet2 Sheet3.

I have a client that sends me weekly updates but always calls the sheet name something different. I have asked him not to but he continues to change it.

Thanks
4 REPLIES 4
deleted_user
Not applicable
Try this

libname xls excel 'c:\test.xls';

data t;
set sashelp.vtable;
where libname = 'XLS';
run;


GL
Oleg_L
Obsidian | Level 7
Hi,

Mr. Data _null_ provided very good solution a year ago:

http://support.sas.com/forums/thread.jspa?messageID=23307嬋

Oleg.
deleted_user
Not applicable
Thank you both - these are both great ways to do it! Cheers!
Peter_C
Rhodochrosite | Level 12
Neil

just to dig a little into the dictionary tables, you may find the engine column of dictionary.members useful when working with more than one workbook (or libname) .... Try code:[pre] proc sql ;
create table sheets as select * from dictionary.members where engine= 'EXCEL' ;
quit ;[/pre]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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