Previous Page | Next Page

Directing SAS Output and the SAS Log

Storing the Output and the SAS Log in the SAS Windowing Environment

Understanding the Default Destination

Within the SAS windowing environment, the default destination for most procedure output is a monospace listing that appears in the Output window. However, you can use the Output Delivery System (ODS) to change which destinations are opened and closed.

Each time you execute a procedure within a single session, SAS appends the output to the existing output. To view the results, you can

The SAS windowing environment interacts with certain aspects of the ODS to format, control, and manage your output.

In the SAS windowing environment, the default destination for the SAS log messages is the Log window. When you execute a procedure, SAS appends the log messages to the existing log messages in the Log window. You can scroll the Log window to see the results. To print your log messages, execute the PRINT command. To clear the contents of the Log window, execute the CLEAR command. When your session ends, SAS automatically clears the window.

Within the SAS windowing environment, you can use the PRINTTO procedure to route log messages or procedure output to a location other than the default location, just as you can in other methods of operation. For details, see Routing the Output and the SAS Log with PROC PRINTTO. You can also use ODS to change the destination of the procedure output.

For additional information about using ODS, viewing procedure output, and changing the destination of the procedure output, see Understanding and Customizing SAS Output: The Basics.

Storing the Contents of the Output and Log Windows

If you want to store a copy of the contents of the Output or Log window in a file, then use the FILE command. On the command line, specify the FILE command followed by the name of the file:

file 'file-to-store-contents-of-window'

SAS has a built-in safeguard that prevents you from accidentally overwriting a file. If you inadvertently specify an existing file, then a dialog box appears. The dialog box asks you to choose a course of action, provides you with information, and might prevent you from overwriting the file by mistake. You are asked whether to:

Previous Page | Next Page | Top of Page