Download presentation
Presentation is loading. Please wait.
1
a useful SAS 9.2 feature I wasn’t aware of *
Dr. Arthur Tabachneck Director, Data Management * stolen from a SAS-L post by Mike Zdeb
2
suppose you had the following task
you’re given an Excel spreadsheet with separate worksheets for each day you have to combine them into one SAS file adding a new column showing the date (i.e., each worksheet’s sheet name)
3
part 1: read all of the worksheet names
a solution part 1: read all of the worksheet names libname x ‘c:\thedata.xls'; proc sql noprint; select catt('x.',memname,'n') into :dsets separated by ' ' from dictionary.tables where libname eq 'X'; quit; Note: we ALL knew that!
4
a solution part 2: use indsname option to get and assign the dates data want; set &dsets. indsname=dsn; date=input(scan(dsn,2,"'$"),date9.); run; Since DSN will appear as x.’08Feb2010$’n
5
Questions? Your comments and questions are valued and encouraged.
Contact the author: Dr. Arthur Tabachneck Director, Data Management Insurance Bureau of Canada Toronto, Ontario L3T 5K9
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.