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
September 2012
(for SAS and WPS)

When I run some programs, I don't want all the program run to be reflected in the SAS LOG. An example is where I may bring in a FORMATS.SAS file that contains the formats I need to run in the program using a %INC statement.

But what it I was to temporarily suspend output to the SAS LOG for a brief time? The following example will show a way of achieving this:

   %put Include FORMATS.SAS file;
   proc printto log="nul:" new;
   run;
   
   %inc ".\formats.sas";
   run;
   
   proc printto log=LOG;
   run;

The first PRINTTO call sends all LOG statements after this to a file that does not exist, includes the SAS program, then resets the LOG output to the default SAS LOG output file.

This tip is useful if you have a large set of code that is always run and you do not want included in the SAS LOG. However it is always important to remember that not sending a program LOG to a file that you can read runs the risk of you not being able to see what a program is doing, therefore missing potentially serious programs that can affect the ouput.

Hope this is useful. Have a safe and happy September.

See you next month.

________________________________
Updated September 06, 2012