Example: Transforming the Data in the BASEBALL Data Set

  1. In the Tasks section, expand the Data folder, and then double-click Transform Data. The user interface for the Transform Data task opens.
  2. On the Data tab, select SASHELP.BASEBALL as the input data set.
    Tip
    If the data set is not available from the drop-down list, click Select a table icon. In the Choose a Table window, expand the library that contains the data set that you want to use. Select the data set for the example and click OK. The selected data set should now appear in the drop-down list.
    This figure shows a subset of the data for the Name, nRuns, and Salary columns.
    Name, nRuns, and Salary Columns in the Sashelp.Baseball Data Set
  3. To transform the data in the nRuns column, complete these steps under the Transform 1 heading:
    1. To the Variable 1 role, assign the nRuns column.
    2. From the Transform drop-down list, select Natural log.
  4. To convert the values in the Salary column to dollars, complete these steps under the Transform 2 heading:
    1. To the Variable 2 role, assign the Salary column.
    2. From the Transform drop-down list, select Specify custom transformation.
    3. In the Custom transform box, enter Salary*1000.
  5. To run the task, click Submit SAS Code.
The output data set contains two additional columns. The log_nRuns column lists the values of the natural log of the values in the nRuns column. The tr2_Salary columns contains the values from the Salary column multiplied by 1,000.
Subset of Work.Transform Data Set