Managing Your Data in the SAS Windowing Environment |
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 that has a one-level name will be placed in the Work library by default, and will be 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. 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.
The following display shows large icon representation for the Sashelp library:
Sashelp Library Represented by Large Icons
If you select the Sashelp library and then select View Details, the contents of the Sashelp library displays, along with the size and type of the data sets:
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.
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:
With the SAS Explorer window active, select File shortcuts from the left pane.
Right-click in the right pane to select New File Shortcut from the menu.
In the File Shortcut Assignment window that appears, type the name of the fileref you want to use in the Name field.
Type the full pathname for the file in the File field.
The following display shows the File Shortcut Assignment window:
By default, filerefs you create are temporary and can be used in the current SAS session only. Selecting Enable at Startup 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:
Open SAS Explorer and select a library.
The contents of the library appears in the right pane.
Right-click the data set that you want to rename.
Select Rename from the menu, and type the new name of the data set.
Click OK.
Copy 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:
Open SAS Explorer and select a library.
The contents of the library appears in the right pane.
Right-click the data set you want to copy or duplicate.
From the menu that displays, 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.
If you choose Copy, do the following:
Left-click the library in the left pane of SAS Explorer to select the library or catalog to which the data set will be copied.
In the right pane, right-click the mouse and select Paste from the menu that displays.
A copy of the data set now resides in the new directory.
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:
Open SAS Explorer and select a library.
The contents of the library appear in the right pane.
Right-click the data set that you want to view.
Select Properties from the menu.
The following window appears:
In the Description field of the General tab, you can enter a description of the data set. To save the description click OK.
Select other tabs to display additional information about the data set.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.