Introduction to Managing Your Data in the SAS
Windowing Environment
The SAS windowing environment contains windows that enable you to perform
common data manipulation and make changes without writing code.
If you are not familiar with SAS or with writing code in the SAS language, then you
might find the windowing environment helpful. With the windowing environment, you
can open a data set, point to rows and columns in your data. Then, you can click menu
items to reorganize and perform analyses on the information.
For more information about the SAS windowing environment, select SAS Help and
Documentation from the Help menu after you invoke a SAS session.
Managing Data with SAS Explorer
Introduction to Managing Data with SAS Explorer
You can use SAS Explorer to view and manage data sets. Data sets are stored in
libraries, which are storage locations for SAS files and catalogs. By default, SAS defines
several libraries for you:
Sashelp
is a library created by SAS that stores the text for Help windows, default function-
key definitions, window definitions, and menus.
Maps
is a library created by SAS that presents graphical representations of geographical or
other areas.
Sasuser
is a permanent SAS library that is created at the beginning of your first SAS session.
This library contains a Profile catalog that stores the customized features or settings
that you specify for SAS. (You can store other SAS files in this library.)
Work
is a library that is created by SAS at the beginning of each SAS session or SAS job.
Unless you have specified a User library, any newly created SAS file with a one-
level name is placed in the Work library by default. The newly created file is deleted
at the end of the current session or job.
Viewing Libraries and Data Sets
Libraries and data sets are represented in SAS by large icons, small icons, or as a list.
With the Explorer window active, you can change this representation by selecting an
option from the View menu:
To view large icons, select Large Icons from the View menu.
To view small icons, select Small Icons from the View menu.
To view data sets in a list, select List from the View menu.
376 Chapter 17 Managing Your Data in the SAS Windowing Environment
The following example uses large icons to show the contents of Sashelp:
Figure 17.1 Sashelp Library Represented by Large Icons
If you select the Sashelp library and then select View ð Details from the menu bar, the
contents of the Sashelp library is displayed, along with the size and type of the data sets:
Figure 17.2 Detailed View of the Sashelp Library
If you double-click a table in this list, the data set opens. The VIEWTABLE window,
which is a SAS table viewer and editor, appears and is populated with the data from the
table.
Managing Data with SAS Explorer 377
Assign File Shortcuts
A file shortcut is also known as a file reference or fileref. Filerefs save you programming
time by enabling you to assign a nickname to a commonly used file. You can use the
FILENAME statement to create a fileref, or you can use the File Shortcut Assignment
window from SAS Explorer.
To assign a fileref to a file, follow these steps:
1. Select Tools ð New File Shortcut from the menu.
2. In the File Shortcut Assignment window that appears, enter the name of the fileref
that you want to use in the Name field.
3. Enter the full pathname for the file in the File field.
The following display shows the File Shortcut Assignment window:
By default, filerefs that you create are temporary and can be used in the current SAS
session only. Selecting Enable at Start-up from the File Shortcut Assignment window,
however, assigns the fileref to the file whenever you start a new SAS session.
Rename a SAS Data Set
You can rename any data set in a SAS library as long as it is not Write protected. To
rename a data set, follow these steps:
1. Open SAS Explorer and select a library.
The contents of the library appear in the right pane.
2. Right-click the data set that you want to rename.
3. Select Rename from the menu, and enter the new name of the data set.
378 Chapter 17 Managing Your Data in the SAS Windowing Environment
4. Click OK.
Copy or Duplicate a SAS Data Set
You can copy a SAS data set to another library or catalog, or you can duplicate the data
set in the same directory as the original data set. To copy or duplicate a data set, follow
these steps:
1. Open SAS Explorer and select a library.
The contents of the library appear in the right pane.
2. Right-click the data set you want to copy or duplicate.
3. From the menu that is displayed, choose Copy to copy a data set to another library or
catalog, or choose Duplicate to copy the data set to the same library or catalog.
4. If you choose Copy, do the following:
a. Click the library in the left pane of SAS Explorer to select the library or catalog
into which the data set will be copied.
b. In the right pane, right-click the mouse and select Paste from the menu that
appears.
A copy of the data set now resides in the new directory.
5. If you choose Duplicate, then the Duplicate window appears. In the Duplicate
window, SAS appends _copy to the data set name (for example, data-set-
name_copy).
Do one of the following:
Keep the name and click OK.
Create another name for your duplicated data set and click OK.
Sorting Data Sets in a Library
Data sets in SAS Explorer are sorted automatically by name. You can change the sort
order of the data sets by size or type by clicking the Size or Type column. To return data
sets to their original order, select the Refresh option from the View menu.
View the Properties of a SAS Data Set
You can view the properties of a data set by using the Properties window. To view
properties, follow these steps:
1. Open SAS Explorer and select a library.
The contents of the library appears in the right pane.
2. Right-click the data set that you want to view.
3. Select Properties from the menu.
Managing Data with SAS Explorer 379
..................Content has been hidden....................

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