As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.

SAS log

From sasCommunity
Jump to: navigation, search
This is a work in progress. You can contribute to this article.

The SAS log records program activity, including errors, warnings, notes, information about inputs, outputs, and connections, and debugging information. It is generated by default whenever a SAS program is executed. There are many options for specifying what kind of information is printed to the log, and how detailed it will be.


Consult the SAS documentation for more information on the structure and options relating to the SAS log.

You can also dynamically change the name of the SAS log, using LOGPARM if invoking SAS via the command-line, or using code like so:

/* Writes SAS log to a file/location specified in the code.
   documentation: */
proc printto log='/path/test.log';
/* program code is here */
proc printto;

You can also use proc printto to suppress the SAS log.[1]

Writing to the SAS log

A PUT statement or %PUT macro statement may be used to write to the log. If such a statement begins with "NOTE:", "WARNING:", or "ERROR:", SAS will recognize the keyword and treat it as a note, warning, or error, respectively. For an example, see Mimicking LOG messages.

See also