Drop Columns from the Input Data Source

The original data source includes the number of offenses and rate for each type of violent crime. For your analysis, you want the data to include the number of offenses for murder and nonnegligent manslaughter, robbery, aggravated assault, and burglary only.
To select the columns to include in your analysis:
  1. In the Original Data worksheet, select a cell in the Excel data.
  2. On the SAS tab, click Tasks, and then select Datathen selectSort Data. The Choose Data dialog box appears.
  3. For the input data, select Excel Data. By default, the input data source is the range of Excel data in the Original Data worksheet. In this example, the range of the Excel data is A3:T23. You can also use Button that enables you to select a cell or range in an Excel worksheet.
  4. For the location of the results, select New worksheet. By default, the name of this new worksheet is Sort Data. Rename this worksheet Sorted data.
    Choose Data dialog box for the Sort Data task
    Click OK. The Sort Data task appears.
  5. In the Data panel, complete these steps:
    1. Assign the Year column to the Sort by role.
    2. Assign these columns to the Columns to be dropped role:
      • Violent crime rate
      • Murder and nonnegligent mansla_2
      • Forcible rape
      • Forcible rape rate
      • Robbery rate
      • Aggravated assault rate
      • Property crime
      • Property crime rate
      • Burglary rate
      • Larceny-theft
      • Larceny-theft rate
      • Motor Vehicle theft
      • Motor Vehicle theft rate
    Assigning columns to roles in the Sort Data task
    In the selection pane, click Results.
  6. In the Results panel, specify the location for the output data set. Because you need access to this data source to refresh the SAS content in Microsoft PowerPoint, save this output data to a permanent library rather than the temporary Work library. In this example, the default location is SASApp:SASDATA.Sorted_Crime_Data.
    Location of the Results for the Sort Data task
    Click Run.
    When the Sort Data task finishes, two new worksheets appear in Microsoft Excel.
    • In the Sorted Data worksheet, a placeholder appears. This placeholder displays the date and time that the Sort Data task ran.
    • In the SASDATA.SORTED_CRIME_DATA worksheet, you see a copy of the output data set that the Sort Data task generated. In this example, the name of the worksheet is SASDATA.SORTED_CRIME_DATA. In your workbook, the actual name of this worksheet is the name of the output data set that you specified in the Results panel in the Sort Data task.
      Note: This data set is also saved to the location that you specified in the Results panel.
    Results from the Sort Data task in Excel