How to input Excel data into SAS?

There are many different ways of importing Excel file into SAS Enterprise Guide. This post is going to show, probably the easiest way of doing so.

In our example, we have the following data. The file is called “Book1.xls” and has three worksheets: “to do”, “data01” and “data02”. We want to import the sheet “data02” (see below), that has three fields “Name”, “State” and “Age”.


To import the data, open the SAS application and, in the File menu, choose the item Import Data:


Find the Excel file in your computer.


After choosing the file, SAS will open the Import Data wizard in four steps. First, it describes the source data file and gives an option to choose where the file is going to be saved in the SAS Server.
Chick on Browse to select another location (library).


Remind that our file has three sheets. We are going to use the sheet “data02”. Also, in our data, the first row contains the field names. All this info is defined in the next window, which is the most important window in the Import Data wizard.


Third window defines the field attributes. Here SAS, by default, does a really good job recognizing the fields’ formats. In case you want to change something, chick on Modify.
























In the last window, usually no inputs are required. Just click on Finish.


The data is going to be available in the library specified. The Output Data tab also shows the imported data.





No comments:

Post a Comment