LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 10 Feb 2010 21:40:06 -0500
Reply-To:     msz03@albany.edu
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mike Zdeb <msz03@ALBANY.EDU>
Subject:      Re: import multiple tabs in 1 Excel file
Content-Type: text/plain;charset=iso-8859-1

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 ' ' from dictionary.tables where libname eq 'X'; quit;

* use the indsname option to grab the sheet name; data all; set &dsets indsname=dsn; dset = scan(dsn,2,"'$"); run;

libname x clear;

-- Mike Zdeb U@Albany School of Public Health One University Place Rensselaer, New York 12144-3456 P/518-402-6479 F/630-604-1475

> 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 > > -Tina >


Back to: Top of message | Previous page | Main SAS-L page