Help using Base SAS procedures

How to clear SAS logs automatically?

Reply
Contributor
Posts: 72

How to clear SAS logs automatically?

Hi everyone,

How can I clear the SAS logs automatically so I don't have to sit at my desk to click the "Clear" option on the message window everytime the logs get full?

I've tried the following but still the windows keep coming up for me to choose either of the options.

filename templog "C:\Research\DataCollection\tempsaslog.txt";
proc printto log templog;

"my program code"

proc printto log = log;
run;

Can you please advise?
Super User
Posts: 17,898

Re: How to clear SAS logs automatically?

I think you might have your code in the wrong order.
proc printto goes before your sas program statements or you're missing an equal sign.




The following code redirects my log in SAS 9.2 (from the documentation).

*set log to temp file;
filename myfile 'c:\temp\mylog.log';
proc printto log=myfile;
run;

proc print data=sashelp.class;
run;

*reset log output;
proc printto;
run;
Super Contributor
Posts: 291

Re: How to clear SAS logs automatically?

if you have fully debugged your code, you could add the following option to suppress much of the log output:

options nosource nonotes; You will still get warnings and error messages.
Super User
Posts: 10,528

Re: How to clear SAS logs automatically?

If you are using F8 or other key to submit your job, you could change the entry in the KEYS menu item to: Log;clear;submit;log;

This will clear the log before each program submitted.
Occasional Contributor
Posts: 17

Re: How to clear SAS logs automatically?

Where do I find the Keys menu?? I am using SAS studio edition

Super User
Posts: 3,112

Re: How to clear SAS logs automatically?

There is no KEYS window in SAS Studio as function keys are not customisable.

Contributor
Posts: 72

Re: How to clear SAS logs automatically?

Wow, that's so wonderful! Thank you all for the help. Now I know several ways to clear the SAS logs :-)
Ask a Question
Discussion stats
  • 6 replies
  • 29120 views
  • 2 likes
  • 6 in conversation