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, VIEWTABLE. In the
VIEWTABLE window, you can create a new table, and view or edit an existing table.
Opening a SAS Data Set in a VIEWTABLE Window
You can open an existing SAS data set in a VIEWTABLE window by double-clicking on
the SAS data set icon in the SAS Explorer window, or by specifying the VIEWTABLE
command in the SAS Display Manager command line. The following sections provide
details about using either of these two methods.
Using the SAS Explorer Window
Here are the steps for using the SAS Explorer window to open a SAS data set in a
VIEWTABLE window:
1. Open SAS Explorer and double-click on the icon for the library that contains the
target data set.
2. Select the desired data set and double-click on its icon.
380 Chapter 17 Managing Your Data in the SAS Windowing Environment
3. The VIEWTABLE window should appear, populated with data from the data set.
4. Use the scroll bar on the VIEWTABLE window to view all of the data.
Using the VIEWTABLE Command
You can also open a data set in a VIEWTABLE window by using the VIEWTABLE
command in the SAS Display Manager command line.
1. Specify the VIEWTABLE command in the SAS Display Manager command line
using the following syntax:
VIEWTABLE data-set-name <-options>
2. Here is an example:
viewtable cars
Working with VIEWTABLE 381
Displaying Table Headers as Names or Labels
When you open a data set that contains labels in a VIEWTABLE window, SAS
automatically displays the table headers as variable labels rather than the variable names.
You can change the way SAS displays table headers by using the VIEWTABLE pop-up
menu or by using the VIEWTABLE command.
Using the VIEWTABLE pop-up menu to change the way table headers are
displayed:
1. Open a data set in VIEWTABLE (to access the VIEWTABLE pop-up menu, you
must have an active VIEWTABLE window open).
2. Make sure that the VIEWTABLE window is active.
3. Select View ð Column Names or View ð Column Labels from the drop-down
View menu.
4. Once this selection is made, the opened table, and all tables that are subsequently
opened, will display table headers based on this setting in the VIEWTABLE pop-
up menu. 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.
This feature is available in SAS 9.4M1 and later releases.
Using the VIEWTABLE command to change the way table headers are displayed
when a table is opened:
1. Specify the COLHEADING= option on the VIEWTABLE command in the SAS
command line using the following syntax.
VIEWTABLE data-set-name -<COLHEADING>=NAMES | LABELS>
2. Here is an example:
viewtable cars colheading=names
382 Chapter 17 Managing Your Data in the SAS Windowing Environment
Customizing SAS Explorer for Opening the VIEWTABLE Window
You can customize SAS Explorer to open a VIEWTABLE window so that column
headings are displayed as either names or labels every time that the table is opened from
the SAS Explorer window. To do this, add the COLHEADING= option to the Action
Command in the SAS Explorer Options dialog box.
1. With the SAS Explorer window active, select Tools ð Options ð Explorer to open
the Explorer Options window.
2. Select the Members tab.
3. Select Table in the list of registered types, and then click Edit to open the TABLE
Options dialog box.
4. Select the &Open Action Command in the list of actions, and then click Edit to
open the Edit Action dialog box.
5. In the Edit Action dialog box, add -COLHEADING=<value> to the end of the
VIEWTABLE command:
VIEWTABLE %8b.'%s'.DATA colheading=names
Working with VIEWTABLE 383
6. When you are finished making changes, click OK three times to exit all of the open
dialog boxes. From this point on, when you use the SAS Explorer Window to open
the VIEWTABLE window, SAS displays the table headers according to what you
specified in this SAS Explorer dialog box.
Note: These steps only affect how tables are displayed when they are opened from the
SAS Explorer Window (either by double-clicking on the icon or by right-clicking on
the icon and selecting "Open"). They do not affect how tables are opened when you
use the VIEWTABLE command to open a table.
Order of Precedence for How Column Headings Are Displayed
If you open a table using the VIEWTABLE command and you do not specify
COLHEADING= to control how column headings should be displayed, then SAS will
display column headings based on how they were last set in the VIEWTABLE pop-up
menu (View ð Column Names or View ð Column Labels).
If you open a table using the VIEWTABLE colheading=<value> command, SAS will
display the column headings according to the COLHEADING value, regardless of how
column headings are set in the VIEWTABLE pop-up menu. The setting in the
VIEWTABLE pop-up menu will reflect the COLHEADING= value. In other words,
COLHEADING= overrides the setting specified in the VIEWTABLE pop-up menu.
For information about the LABEL statement in SAS, see “LABEL Statement” in SAS
Statements: Reference.
Mapping the VIEWTABLE Command to a Function Key
You can map a Function Key in the Display Manager Keys window to execute the
VIEWTABLE command. To do this, follow these steps:
1. Select Tools ð Options ð Keys from the SAS menu. The Keys window will appear.
384 Chapter 17 Managing Your Data in the SAS Windowing Environment
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.97.40