SAS log

From sasCommunity
(Redirected from SAS logs)
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.

Options

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: https://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001330273.htm */
 
proc printto log='/path/test.log';
run;
 
/* program code is here */
 
proc printto;
run;

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