Previous Page | Next Page

Using the SAS Windowing Environment

Working with Files


Ways to Find a File

There are a number of ways in which you can find a file or library member in the SAS windowing environment, including the following:


Using Explorer to Find a File

When the SAS windowing environment opens, the Explorer window also opens by default in many operating environments. You can issue the EXPLORER command to open the Explorer window if it does not open by default.

Note:   You might find it useful to use specific navigational tools to move through the different levels of the Explorer window:

Menu View [arrow] Up One Level
Command

UPLEVEL

  [cautionend]

For more information about selecting an Explorer window view, see Customizing the Explorer Window.


Using the Find Window to Find a File

The Find window enables you to search for an expression (such as a text string or a library member) that exists in a SAS library. The default search looks at everything in the library, except catalogs, but you can click the check box for the search to include the catalogs in the library as well.

The Find Window

[The Find Window]

To search for a file:

  1. Select Tools [arrow] Find from the Explorer window to open the Find window.

    Alternatively, issue the EXPFIND or EXPFIND <library-name> command. If you issue the EXPFIND command, then SASUSER is the default library. If you issue the EXPFIND WORK command, then WORK is the default library.

  2. In the Search For field, enter the expression that you want to find. Wildcard characters are acceptable.

  3. From the Search In drop-down list, select the library in which you want to search.

  4. Click Search Catalogs to expand the search to include the catalogs of the library that you have selected.

    Searching catalogs can lengthen search time considerably depending on the size and number of catalogs in the library.

  5. Click Find.


Example: Finding Files with the Find Window

You can find TABLE files that begin with a specific letter and exist in a specific library. For a file that starts with the letter S and which exists in the SASHELP library

  1. Select Tools [arrow] Find to open the Find window.

  2. Type s*.table in the Search For field.

  3. Select SASHELP from the Search In drop-down list.

  4. Click Find.


Issuing File-Specific Commands

There are a number of commands that you can issue against a file after you find the file in the SAS windowing environment. The commands that are available are determined by the type of file with which you are working.

  1. Find the file with which you want to work. For more information, see Ways to Find a File.

  2. Select the file, and then right-click the file. A list of file-specific commands appears from which you can make a selection.

Operating Environment Information:   If you are using the z/OS or CMS operating environment, then you can open a pop-up menu by typing ? in the selection field next to an item. Alternatively, you can type an s or x in the selection field next to an item.  [cautionend]


Opening Files

There are a number of ways in which you can open files in the SAS windowing environment.

To open a SAS file from Explorer:

  1. Open a library and appropriate library members until you see the file that you want to open.

  2. Select the file, then select Open from the pop-up menu.

    Depending on the file type, you might also be able to select Open in Editor.

Note:   In some cases, the pop-up menu also enables you to select Browse in SAS Notepad, which enables you to open a file in the SAS NOTEPAD window.  [cautionend]

To open a file that has a file shortcut:

  1. Open the File Shortcuts folder.

  2. Select a file shortcut, and then select Open from the pop-up menu.


Assigning a File Shortcut

File shortcut references provide aliases to external files (such as a .sas program file or a .dat text file). A file shortcut is the same as a file reference or fileref. In operating environments that support drag and drop functionality, you can drag file shortcuts from the Explorer window to the Editor window to display their contents.

To assign a file shortcut

  1. From the Explorer window, select the File Shortcuts folder.

  2. Select File [arrow] New.

  3. In the Name field of the File Shortcut Assignment window, enter a name for the file shortcut.

  4. Select the method or device that you want to use for the file shortcut.

    The methods or devices that are available from the Method drop-down list depend on your operating environment. The DISK method is the default method (if it is available for your operating environment).

  5. Select the Enable at Startup check box if you want SAS to automatically assign the file shortcut each time SAS starts. This option is not available for all the file shortcut methods.

    If you want to stop a file shortcut from being enabled at startup, then select the file shortcut in the SAS Explorer window, and then select Delete from the pop-up menu.

  6. Fill in the fields of the Method Information area, including the name and location of the file for which you want to create a file shortcut. You can select Browse to locate the actual file. The fields that are available in this area depend on the type of method or device that you select.

    Note:   Selecting a new method type erases any entries that you might have made in the Method Information fields.  [cautionend]

  7. Select OK to create the new file shortcut. The file shortcut appears in the File Shortcut folder of the SAS Explorer window.

You can use the following ways to create a file shortcut, depending on your operating environment:

Menus
File [arrow] New

while your mouse is positioned on File Shortcuts in the Explorer window.

Command

DMFILEASSIGN<file-shortcut-name><METHOD=><AUTO=>

file-shortcut-name

specifies an existing file shortcut reference.

METHOD= method-name

specifies which method to use when the File Shortcut Assignment window opens.

AUTO= Yes|No

sets the state of the File Shortcut Assignment window's Enable at Startup check box when the window opens.

Pop-up

New File Shortcut if you have opened the File Shortcut folder in the Explorer window.

Toolbar

New (while your mouse is positioned on File Shortcuts in the Explorer window.)


Modifying an Existing File Shortcut

You can modify existing file shortcut references, if needed.

From the command line:

  1. Issue the following command:

    DMFILEASSIGN file-shortcut-name

    The File Shortcut Assignment window appears. Its fields include information that is specific to the chosen file shortcut.

  2. Edit the fields of the File Shortcut Assignment window as needed.

From the SAS Explorer:

  1. Right-click the File Shortcuts folder and select Open. Alternatively, you can double-click the folder to open it.

  2. Right-click the file shortcut reference that you want to change, and then select Modify.

  3. Edit the fields of the File Shortcut Assignment window as needed.

Operating Environment Information:   If you are using the z/OS or CMS operating environment, then you can open a pop-up menu by typing ? in the selection field next to an item. Alternatively, you can type an s or x in the selection field next to an item.  [cautionend]


Printing Files

There are a number of ways in which you can print files. Often, printing capabilities depend on the type of file with which you are working, as well as your operating environment.

Nonetheless, the following lists common ways in which you might be able to print a file.

Printing from Explorer

Find the appropriate file in the SAS Explorer window. Right-click over the file, and then select Print.

Printing from a Text Editor

Open your file into a text editor such as the Editor or the SAS NOTEPAD. Use the text editor's printing commands.

Refer to your operating environment documentation for information about printing files.

Previous Page | Next Page | Top of Page