Copying and Viewing Files in a Data Library


Copying a Practice File to the WORK Data Library

The following examples use a copy of the SASHELP.PRDSALE data set, which is a read-only data set in the SASHELP library. In this section, you will learn how to copy SASHELP.PRDSALE to the WORK library, so that you can use it with the other examples in this section.

Note: By default, files located in the WORK directory are deleted at the close of a SAS session.

To copy the PRDSALE file in the SASHELP library to the WORK library, follow these steps:

  1. Open the Explorer window by selecting

    View Explorer

    from the menu.

  2. Make sure you are in Tree view mode by enabling

    View Show Tree

    The Explorer window now contains two panels.

    click to expand
    Display 19.1: Explorer Window Displaying Tree View

  3. In the left panel, click the SASHELP library to show the library contents in the right panel. Scroll to the PRDSALE data set.

  4. Right-click the PRDSALE data set and select Copy from the menu.

    click to expand
    Display 19.2: Explorer Window Displaying Copy Menu Option

  5. In the left panel, right-click WORK and select Paste .

    click to expand
    Display 19.3: Explorer Window Displaying Paste Menu Option

  6. Double-click Work and confirm that the data set was copied .

    click to expand
    Display 19.4: Explorer Window Displaying Copied PRDSALE Data Set (Icon View)

Viewing the Contents of a Data Set with the VIEWTABLE Window

To quickly view the contents of your SAS data set, you can either

  • double-click a file in the SAS Explorer, or

  • open the VIEWTABLE window with the VT command, select

    File Open

    then select the data set.

For this example, use the SAS data set WORK.PRDSALE, which contains sample data for product sales. The WORK.PRDSALE data set was created by copying PRDSALE from the SASUSER library in the previous example. See 'Copying a Practice File to the WORK Data Library' on page 307.

  1. Select

    Tools Table Editor

    to open the VIEWTABLE window.

  2. Select

    File Open

    The Open dialog box displays the current SAS libraries.

  3. Under Libraries , select WORK . The data sets and views in the WORK library are displayed on the right.

  4. Double-click PRDSALE. The VIEWTABLE window opens.

    click to expand
    Display 19.5: Explorer Window Displaying Copied PRDSALE Data Set (Details View)

  5. Scroll the VIEWTABLE window to view the WORK.PRDSALE data.

    click to expand
    Display 19.6: VIEWTABLE Window Displaying PRDSALE Data

  6. To save a copy of this file to use for practice in the next example, click

    File Save as

    The Save As dialog box opens.

    click to expand
    Display 19.7: Data Table Save As Dialog Box

  7. Select the WORK library as your storage location and type Mywork in the Member Name field.

  8. Click Save .

Saving a Data Set as HTML

To save a SAS data set as HTML, follow these steps:

  1. Right-click the file in the SAS Explorer.

  2. Select Save as HTML from the pop-up menu.

  3. Select a location in the Save in box or leave it in the default location.

  4. If you want to save the file with the default name of table-name.html , select Save .

    If you do not want the default name, you can enter a file name and then select Save .

Copying a Data Set to Excel

To copy a SAS data set to Microsoft Excel, you can right-click a file in the SAS Explorer and either

  • select Copy Contents to Clipboard and then click

    File Paste

    in Microsoft Excel, or

  • select View in Excel .

click to expand
Display 19.8: Explorer Window Displaying Copy to Clipboard Menu Option



SAS 9.1 Language Reference. Concepts
SAS 9.1 Language Reference Concepts
ISBN: 1590471989
EAN: 2147483647
Year: 2004
Pages: 255

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net