Genesee Valley SAS Users Group

A group supporting SAS® Users in the Genesee Valley (Rochester, NY) region. Welcome!

Tuesday, June 14, 2005

EXCEL Engine

What’s troubling you, my friend? You say you have an Excel spreadsheet with 18 tabs and you need to read the data from all of them, and you’re too lazy to write 18 different PROC IMPORTs? I can sympathize. However, the EXCEL engine in the LIBNAME statement can come to your rescue.

LIBNAME mylibrary EXCEL 'c:\myExcelFile.xls' header=yes;

Now, you have 18 SAS data sets, one for each tab. To access them, you will need to turn on the option VALIDVARNAME=ANY. If the first tab was named Sheet1, the equivalent SAS data set is named 'mylibrary.Sheet1$'n.

Try it!