The following window appears for the Air data set:
4. In the Description field of the General tab, you can enter a description of the data
set. To save the description, click OK.
5. Select other tabs to display additional information about the data set.
Working with VIEWTABLE
Overview of VIEWTABLE
To manipulate data interactively, you can use the SAS table editor called VIEWTABLE.
In the VIEWTABLE window, you can create a new table, and browse or edit an existing
table.
View the Contents of a SAS Data Set
To view the contents of a data set with VIEWTABLE, follow these steps:
1. Open SAS Explorer and select a library.
The contents of the library appears in the right pane.
2. Double-click a data set within the library.
360 Chapter 17 Managing Your Data in the SAS Windowing Environment
The VIEWTABLE window appears and is populated with data from the data set:
3. Scroll the VIEWTABLE window to view all of the data in your data set.
Displaying Column Names or Column Labels
You can display either column labels or column names in your VIEWTABLE table.
Select VIEW from the menu to look at the option that is selected. You can change how
to display the headings in your table by selecting either Column Labels or Column
Name. In the following examples, column labels are displayed.
Move Columns in a Table
Within the VIEWTABLE window, you can rearrange columns in your table. To move
columns in your table, follow these steps:
1. Click a column heading for the column that you want to move.
2. Drag and drop the heading onto another column heading.
Working with VIEWTABLE 361
In this example, if you click the heading Name, and then drag and drop Name onto
Team at the End of 1986, the Name column moves to the right of the Team at the
End of 1986 column.
Temporarily Change Column Headings
Within the VIEWTABLE window, you can temporarily change column headings. To
temporarily change column headings, follow these steps:
1. Right-click the heading for the column that you want to change, and then select
Column Attributes from the menu.
2. In the Label field of the Column Attributes window, enter the new name of the
column heading and then click Apply.
In this example, the Name heading is replaced by the Name of Player label.
362 Chapter 17 Managing Your Data in the SAS Windowing Environment
When you press Apply, the column heading in VIEWTABLE changes to the new
name.
In this example, the label was changed to Name of Player.
3. Click Close to close the Column Attributes window.
Saving Column Labels or Column Names
When you open a data set using VIEWTABLE and look at the View menu options,
either Column Labels or Column Names is selected. Check the box that you want to
use. When you exit VIEWTABLE or exit SAS, the preference for column labels or
column names is saved. When you open VIEWTABLE or invoke SAS again, the
preference that you chose is automatically selected.
Working with VIEWTABLE 363
This feature is available in SAS 9.4M1 and later releases.
Sort by Values of a Column
You can sort your table in ascending or descending order, based on the values in a
column. You can sort data permanently or create a sorted copy of your table.
To sort your table, follow these steps:
1. Right-click the heading of the column on which you want to sort, and select Sort
from the menu.
2. Select Ascending or Descending from the menu.
3. When the following warning message appears, click Yes to create a sorted copy of
the table.
Note: If you selected Edit Mode after opening the table and clicking a data cell, this
window does not appear. SAS updates the original table.
4. In the Sort window, enter the name of the new sorted table.
364 Chapter 17 Managing Your Data in the SAS Windowing Environment

Get SAS 9.4 Language Reference, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.