Help using Base SAS procedures

Excel to Datasets by passing Macros

Reply
Regular Contributor
Posts: 229

Excel to Datasets by passing Macros

In a Excel work book i have 20 sheets of data .Now i want to create 20 datasets from them by passing a macro.
Valued Guide
Posts: 2,174

Re: Excel to Datasets by passing Macros

why use a macro?
just use a LIBNAME statement.

PeterC
Occasional Contributor
Posts: 12

Re: Excel to Datasets by passing Macros

Yeah thats what i would suggest.

libname test 'c:\excel_file.xls';

what you need to remember is when you are using the sheets in datasteps.

For Example

data New_dataset;
set test."Sheet1$"n;
run;

/*You need to have the sheet1 enclosed within brackets*/
/*there is also a need to include the $ and the n for the */
/*data step to work correctly */
Ask a Question
Discussion stats
  • 2 replies
  • 88 views
  • 0 likes
  • 3 in conversation