Return to Homepage

Goto the Tip of the Month Archive

Other interesting pages ...
LinkedIn Profile
SAS Cheat Sheet
Useful SAS Code
Full SAS Example
Basic Statistics
Contact Information

SAS Tip of the Month
March 2012
(for SAS and WPS)

Sometimes during development or when you are debugging a program, it is useful to have the LOG text and the OUTPUT text go to the same file. This can be done easily using the PRINTTO procedure as shown below:

   proc printto LOG='c:\temp\Program1.log' PRINT='c:\temp\Program1.log' new;

   *More SAS statements;

   proc printto;

The first PRINTTO call will set the SAS LOG and SAS OUTPUT text to the file c:\temp\Program1.log, making sure that any existing output within the file is deleted by using the NEW option. If the NEW option is left off then any new LOG and OUTPUT is added to any existing text.

See you next month.

Updated March 8, 2012