DATA table-name;
INFILE "file-path/file-name.csv" dsd;
INPUT Name $ City $ Age;
RUN;
PROC IMPORT DATAFILE = "file-path/file-name.xlsx" OUT=data_set DBMS=XLSX REPLACE;
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).