To create a SAS table from data in a Microsoft Excel file, you must save the Microsoft Excel file in a shared folder. By default, your shared folder is
/folders/myfolders. You might have additional shared folders, depending on your needs.
Line 1: In the PROC IMPORT statement, specify the name of your Excel file. This file must be saved in one of your shared folders. If your Excel file is saved in My Folders, an example filename is
/folders/myfolders/Sales.xlsx. If you have created additional shared folders, an example filename is
Lines 2: Use the OUT statement to specify where to save the SAS table in the format
Library.Filename. In this example, the SAS table is a file called MYEXCEL and is saved to the Work library, which is a temporary location. If you want this data to persist between sessions, specify a library name for a shared folder.
Line 3: The DBMS statement specifies that you are importing an Excel file.
Line 4: The REPLACE statement specifies to overwrite any existing file with the same name.
Line 5: End your program with the RUN statement.
You can use the PROC PRINT statement to view the new SAS table in SAS Studio.