Date: Wed, 10 Feb 2010 21:40:06 -0500
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Zdeb <msz03@ALBANY.EDU>
Subject: Re: import multiple tabs in 1 Excel file
hi ... here's a V9.2 solution (the INDSNAME option starts in V9.2 )...
* your Excel file;
libname x 'z:\mydata.xls';
* put the names of the sheets into a macro variable;
proc sql noprint;
select catt('x.',memname,'n') into :dsets separated by ' '
where libname eq 'X';
* use the indsname option to grab the sheet name;
set &dsets indsname=dsn;
dset = scan(dsn,2,"'$");
libname x clear;
U@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
> I have an Excel workbook, in which I have multiple worksheets, each of which
> is a daily log of several Job IDs and job volumes. The name of the worksheet
> is like a date, such as "MMDDYY", "MM-DD-YY". Can anyone tell me how to
> write a SAS Macro to read all those worksheets into a single SAS dataset and
> tag each line of data with the date it belongs to?
> Thank you in advance