ALTLOG System Option: UNIX

Specifies the destination for the SAS log.
Valid in: configuration file, SAS invocation, SASV9_OPTIONS environment variable
Category: Environment control: Files
PROC OPTIONS GROUP= ENVFILES, LOGCONTROL
Default: NOALTLOG
UNIX specifics: all

Syntax

–ALTLOG file-specification | –NOALTLOG

Required Arguments

-ALTLOG file-specification
specifies the location where an alternate SAS log is to be written. The file-specification argument can be any valid UNIX path to a directory, a filename, or an environment variable that is associated with a path. If you specify only the path to a directory, the SAS log is placed in a file in the specified directory. The name of the file will be filename.log, where filename is the name of your SAS job. If you are running SAS interactively and specify only the path to a directory, the log is written to a file named sas.log within that path.
-NOALTLOG
specifies that the SAS log is not copied.

Details

ALTLOG Basics

The ALTLOG system option specifies a destination to which a copy of the SAS log is written. All messages that are written to the SAS log are also written to the location specified in file-specification. You can use this option to capture log output for printing.
Note: You can use the LOG option in the PRINTTO procedure to redirect any portion of the log to an external file. The code for PROC PRINTTO will not appear in the SAS log for the current session, but it will appear in the SAS log that you created with the ALTLOG system option.
Note: When SAS is started with the OBJECTSERVER and NOTERMINAL system options and no log is specified, SAS discards all log and alternate log messages.

Using Directives with ALTLOG

Using directives in the ALTLOG system option enables you to control when log copies are open and closed, and how they are named, based on real-time events such as time, month, and day of week. For a list of directives, see LOGPARM= System Option in SAS System Options: Reference.

See Also

Other References:
The SAS Log in SAS Language Reference: Concepts