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:
-
In the Original Data
worksheet, select a cell in the Excel data.
-
On the SAS tab,
click Tasks.
-
In the Tasks window,
select Sort Data. The Choose
Data dialog box appears.
-
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](images/iconchooselocation.png)
.
-
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
.
Click OK.
The Sort Data task appears.
-
In the Data panel,
complete these steps:
-
Assign the Year column
to the Sort by role.
-
Assign these columns
to the
Columns to be dropped role:
-
-
Murder and nonnegligent mansla_2
-
-
-
-
-
-
-
-
-
-
-
In the selection pane,
click Results.
-
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
.
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.