sas PROC IMPORT for Excel, importing a specific sheet


Example

There will be times where you only want to import a specific sheet from an excel file with multiple sheets. To do that, we'll use "SHEET=".

PROC IMPORT 
    OUT= YourNewTable
    DATAFILE= "myfolder/excelfilename.xlsx" 
    DBMS=xlsx 
    REPLACE;
    SHEET="Sheet1";
    GETNAMES=YES;
RUN;

Also take note of the ability to specify whether or not the top row imported contains column names or not (GETNAMES=YES (or NO).