Previous Page | Next Page

Using the SAS Windowing Environment

Working with Output


Overview of Working with Output

You can manage your SAS procedure output with the SAS Output Delivery System (ODS). Procedures that fully support ODS can do the following:

The SAS windowing environment enables you to use many features of ODS through the Results, Templates, Preferences, and SAS Registry Editor windows. The Results window provides pointers to the procedure output that is produced by SAS. The Templates window provides a way to manage all the table, column header, and style definitions (sometimes called templates) that can be associated with procedure output.

Finally, the Preferences window and the SAS Registry Editor can be used to set the type(s) of procedure output that you want SAS to produce.

This section details only those portions of ODS that are related to the SAS windowing environment. For more information about ODS, see Directing SAS Output and the SAS Log and SAS Output Delivery System: User's Guide.


Setting Output Format

Depending on your operating environment, SAS output can be produced in one or more formats (or types). Listing output is the default type. Other output types include HTML, Output Data Sets, and PostScript. Pointers to procedure output appear in the Results window.

To set your output type, use either the Preferences window (if available in your operating environment), the SAS Registry Editor, or both.


Setting Output Type with the Preferences Window

If your operating environment supports the Preferences window, you can set output type as follows:

  1. Select Tools [arrow] Options [arrow] Preferences or issue the DLGPREF command to open the Preferences window.

  2. Select the Results tab.

  3. Select or deselect the check boxes that match the output types that you want to produce.

    If you choose to produce HTML output, then you can further define the output by selecting:

    • an HTML style

      Click the Style box and highlight a style. Styles among other things, define output colors and fonts.

    • the folder to which the output is saved

      Select Use WORK folder to save HTML output only for the duration of the current session. Your output is deleted when your current SAS session ends.

      Enter a path in the Folder text box to save HTML output to a folder that is not deleted when your SAS session ends.

    • the View Results as they are Generated check box

      If selected, then each time HTML output is produced, your browser automatically opens and loads the output.


Setting Output Type with the SAS Registry Editor

To set output type with the SAS Registry Editor:

  1. Select Solutions [arrow] Accessories [arrow] Registry Editor or issue the REGEDIT command to open the SAS Registry Editor.

  2. From the tree on the left side, expand the ODS folder.

  3. Expand the Preferences folder.

  4. Select the appropriate output type.

  5. On the right side, select the Value key, and then select Modify from the pop-up menu.

  6. In the dialog box that appears, edit the Value Data field as needed.

    If this field is set to 1, then the output type is produced. If this field is set to 0, then the output type is not produced.


Assigning a Default Viewer to a SAS Output Type

When you produce output in SAS, output pointers appear in the Results window. You can assign a default viewer for each of the types of output that you produce. After a default viewer is assigned, you can double-click an output pointer in the Results window to open output in its default viewer. For example, double-clicking on a PostScript output pointer could open Ghostview with your PostScript output loaded.

Operating Environment Information:   In the Windows operating environment, default viewers are established automatically with information from your Windows Registry.  [cautionend]

To assign a default viewer to a SAS Output Type:

  1. From the Explorer window, select Tools [arrow] Options [arrow] Explorer.

  2. Select Host Files from the drop-down menu at the top of the Explorer Options window.

  3. Scroll through the registered file types until you find the file type with which you want to work.

  4. Select the appropriate file type, and then select Edit.

  5. Select Add, and then enter an action name and action command for the file type in the Edit Action window.

    For example, add the following action name and action command to set Ghostview as the default viewer for PostScript file types:

    Action Name

    &Edit

    Action Command

    x ghostview '%s' &

  6. Select OK from the Edit Action window.

  7. Select the action that you just specified, and then select Set Default.

Operating Environment Information:   In the Windows operating environment, default viewers are established automatically with information from your Windows Registry.  [cautionend]


Working with Output in the Results Window

The Results window provides pointers to the procedure or DATA step output that SAS produces. This window might open by default when you start a SAS session. You can also open the Results window by selecting View [arrow] Results or by issuing the ODSRESULTS command.

The Results Window in Tree View

[The Results Window in Tree View]

You can use the Results window to do the following:


Customizing the Results Window View

You can have the Results window display in one of three views:

In Tree view (the default), only a navigational tree is present. In Contents Only view, the tree is turned off, and contents appear as folders. In Explorer view, the Results window appears with two panes: one for the tree and one for the contents.

To toggle the Tree view pane, issue the TREE command from the Results window. To toggle the Contents pane, issue the CHILD command from the Results window. You can also select commands from the View menu of the Results window to perform the same actions, such as Show Tree, Show Contents, and others.

Note:   By default, output pointers are listed by label rather than by name in the Tree pane. Labels are typically more descriptive than output names. You can use the following SAS system option to change this setting: LABEL.  [cautionend]


Using Results Pointers to Navigate Output

When SAS runs a procedure or a DATA step, pointers to the output are placed in the Results window. To use the pointers in the Results window, see Navigating the Results Window in Tree View, Navigating the Results Window in Contents Only View, or Navigating the Results Window in Explorer View.


Navigating the Results Window in Tree View

In Tree view, output pointers appear in a procedural hierarchy. To work with your SAS output:

  1. Locate the folder that matches the procedure output that you want to view.

  2. Use the expansion icons (+ or - icons) next to the folder to open or hide its contents.

    You can also:

    • Double-click a folder to make it expand or collapse.

    • Select a folder, and then select Open from the pop-up menu.

  3. When you locate the appropriate pointer, double-click the pointer or select the pointer and then select Open from the pop-up menu.

    The appropriate output appears.

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]

You can also use the following ways to navigate in the Tree view:

Menu View [arrow] Up One Level
Command

UPLEVEL

Toolbar

Up One Level icon

Key

Depending on your operating environment, you might also use arrow and backspace keys to navigate.


Navigating the Results Window in Contents Only View

In Contents Only view, output pointers appear in a procedural hierarchy, beginning with the top level of the hierarchy. You can drill down or roll up within the hierarchy to find the appropriate output.

When you open a folder, the current window contents are replaced with the contents of the selected folder. To work with your SAS output:

  1. Locate the folder that matches the procedure output that you want to view.

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

    You can also double-click a folder to open it.

  3. When you locate the appropriate pointer, double-click the pointer or select the pointer, and then select Open from the pop-up menu.

    The appropriate output appears.

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]


Navigating the Results Window in Explorer View

In Explorer view, two window panes exist. The left pane includes a hierarchical view (the Tree view) of the procedure output that you can view. The right pane shows the contents (the Contents view) of the item that is currently in focus.


Deleting Results Pointers

You can delete results pointers by deleting the procedure folder in which the pointers exist. When you delete a procedure folder in the Results window, any output pointer that exists in that folder is removed.

Note:   When you delete a procedure folder that contains a listing output pointer, the actual listing output is removed from the Output window. If other output pointers exist in the folder (such as HTML), then only the pointer is removed; the actual output remains available.  [cautionend]

To delete procedure output:

  1. In the Results window, select the procedure folder that matches the procedure that you want to delete.

  2. Select Delete from the pop-up menu.

  3. Select Yes to confirm the deletion.

Tip

You can also delete output pointers by selecting the procedure folder that you want to delete, and then selecting Edit [arrow] Delete.


Renaming Results Pointers

To rename results pointers:

  1. Select the pointer that you want to rename.

  2. Select Rename from the pop-up menu.

  3. Type in a new name and/or a description, and then select OK.

Tip

You can also rename results pointers by selecting the pointer that you want to rename, and then selecting Edit [arrow] Rename.


Saving Listing Output to Other Formats

To save listing output to a file from the Results window:

  1. Expand the Results window tree until you find the appropriate listing output pointer.

  2. Select the listing output pointer, and then select Save As from the pop-up menu.

To save listing output to a file from the Output window:

  1. Access the Output window.

  2. On the command line, specify the FILE command followed by a fileref or an actual filename. If you use a filename, then surround the filename with quotation marks.

Note:   The FILE command stores a copy of the information in the Output window without removing what is currently displayed.  [cautionend]

To save listing output as a catalog object:

  1. Expand the Results window tree until you find the appropriate listing output item.

  2. Select the listing output item, and then select Save As Object from the pop-up menu.


Viewing the First Output Pointer Item

To view the first output pointer item:

  1. Select the appropriate results pointer.

  2. Select View from the pop-up menu.

    The first output pointer item listed for the results pointer that you selected appears. For example, if you produced listing and HTML output for a procedure and the listing output was created first, then the listing output would appear.


Viewing Results Properties

You can view the properties of a Results window folder, an output pointer, or an output pointer item (such as listing or HTML output).

  1. In the Results window, select the appropriate folder, output pointer, or output pointer item.

  2. Select Properties from the pop-up menu.


Working with Output Templates


Overview of Working with Output Templates

Templates contain descriptive information that enables the Output Delivery System (ODS) to determine the desired layout of a procedure's results.

The Templates window provides a way to manage all the templates that are currently available to SAS. Specifically, you can use the Templates window to do the following:

The Templates Window in Explorer View

[The Templates Window in Explorer View]

You can open the Templates window by selecting View [arrow] Templates from the Results window, or by issuing the ODSTEMPLATES command.

You can create or modify templates with PROC TEMPLATE.

Note:   Templates that are supplied by SAS are stored in SASHELP. Templates that are created with PROC TEMPLATE are stored in SASUSER or whatever library that you specify in the ODS PATH statement.  [cautionend]


Customizing the Templates Window View

The Templates window appears in one of three views:

In Explorer view (the default), the Templates window appears with two panes: one for the tree and one for the contents. In Tree view, only a navigational tree is present. In Contents Only view, the tree is turned off.

To toggle the Contents pane, issue the CHILD command from the Templates window. To toggle the Tree pane, issue the TREE command from the Templates window.

For more information, see Navigating the Templates Window in Explorer View, Navigating the Templates Window in Tree View, or Navigating the Templates Window in Contents Only View.


Navigating the Templates Window in Explorer View

In Explorer view, two window panes exist. The left pane includes a hierarchical view (the Tree view) of the templates that you can view. The right pane shows the contents (the Contents view) of the template currently in focus.

You can open additional template windows from the Explorer view by selecting a template, and then selecting Explore from Here from the pop-up menu.


Navigating the Templates Window in Tree View

In Tree view, templates appear in a hierarchy. To work with a template:

  1. Locate the folder that includes the template that you want to view.

  2. Use the expansion icons (+ or - icons) next to the folder to open or hide its contents.

    You can also do the following:

    • Double-click a folder to make it expand or collapse.

    • Select a folder, and then select Open from the pop-up menu.

  3. Double-click the template that you want to see, or select the template, and then select Open from the pop-up menu.

    The template code appears in a browser window.

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


Navigating the Templates Window in Contents Only View

In Contents Only view, templates appear as folders. When you open a folder, the current window contents are replaced with the contents of the selected folder. To work with your templates in this view:

  1. Locate the folder that includes the template that you want to view.

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

    You can also double-click on a folder to open it.

  3. Double-click on the template that you want to see, or select the template, and then select Open from the pop-up menu.

    The template code appears in a browser window.

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


Browsing PROC TEMPLATE Source Code

To browse the PROC TEMPLATE source code:

  1. Locate the appropriate template in the Templates window.

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

    Template code appears in a browser window.


Editing PROC TEMPLATE Source Code

To edit the PROC TEMPLATE source code:

  1. Locate the appropriate template in the Templates window.

  2. Select the template, and then select Edit from the pop-up menu. Template code appears in an editor window.

  3. Modify the template code as needed.

  4. Select Run [arrow] Submit to submit your modified template code.

Note:   If syntax errors occur when the code for an edited template is submitted, then the errors appear in the Log window.  [cautionend]

Note:   Additional information for PROC TEMPLATE is available in the Base SAS Procedures Guide.   [cautionend]


Viewing Template Properties

To view template properties:

  1. Locate the appropriate template in the Templates window.

  2. Select the template, and then select Properties from the pop-up menu.

The Properties dialog box lists the type, path, size, description, and modification date for the template. You can also view this information by selecting View [arrow] Details when the Templates window is active.


Printing Output

The method that you use to print output depends on the type of output that you produce, as well as your operating environment. SAS windowing environment windows have menus with print options that enable you to print the contents of that particular window. This feature varies from operating system to operating system, but is available in all operating environments.

If you produce HTML output, then you can open the output in a Web browser, and then print the output from the Web browser with the Web browser's printing command.

For more information about printing, refer to your SAS operating environment companion documentation and your operating environment documentation.

Previous Page | Next Page | Top of Page