If you’re not
an experienced SAS programmer or if you need an existing program to
help you get started, SAS Studio can help. You can open a table in
the table viewer, select which columns to display, and filter and
sort the data. Behind the scenes, SAS Studio writes all the code that
is needed to display the table and makes that code available to you.
From the Libraries section,
double-click the Class table to open it in the table viewer.
In the
Columns area
of the table viewer, all of the columns are selected by default. Clear
the
Weight column and notice that it is immediately
removed from the table viewer.
Next, you can add a
filter and sort the data. Right-click the
Age column
heading, and select
Add Filter. From the
list of column values, hold down the Ctrl key and select three values:
11,
12, 13
.
Click
Filter.
The table viewer is updated and now displays only the rows for ages
11, 12, and 13.
Note: The filter criteria are displayed
at the top of the table viewer. You can click
to edit the filter and
to delete the filter.
Finally, right-click
the
Height column heading and select
Sort
Ascending. The table is sorted by the values of the Height
column from smallest to largest.
While you’ve
been selecting options and customizing the table to get it just the
way you want it, SAS Studio has been generating SAS code that you
can use. To view the code, click
on the toolbar. A new program window appears with
the code that was used to create the view of the table in the table
viewer.
This program is a copy
of the code that SAS Studio created and is no longer associated with
the table viewer. Editing this program does not affect the data that
is displayed in the table viewer, and modifying the table viewer does
not affect the contents of this code. You can edit this code, or use
it as the basis for another program.