How to Import Excel files into SAS
Reading from Excel Spreadsheets: Microsoft Excel spreadsheets can be read from SAS in several ways. Two of these will be demonstrated here. First, PROC IMPORT allows direct access to Excel files through SAS/Access to PC File Formats or access to Comma-Separated (CSV) files through Base SAS. The second method uses the Excel LIBNAME engine. PROC IMPORT The IMPORT procedure reads from external sources and creates a SAS data set. Two sources are Excel spreadsheets and CSV files. A particular SAS/Access product may be required for certain sources, however. In our example, SAS/Access to PC File Formats is required to read an Excel file, but a CSV file can be accessed with Base SAS. General Syntax for PROC IMPORT: PROC IMPORT DATAFILE=" c:\sas\ego.csv " OUT=jeeshim.egov DBMS=CSV REPLACE; For Excel you use the DATAFILE =”filename” option to specify the Excel file to be read. (The TABLE=”tablename” option would be applicable if you were reading from a database such as Microso...