BookmarkSubscribeRSS Feed
smilingmelbourne
Fluorite | Level 6
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?
6 REPLIES 6
Reeza
Super User
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;
Bill
Quartz | Level 8
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.
ballardw
Super User
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.
bluemountains
Obsidian | Level 7

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

SASKiwi
PROC Star

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

smilingmelbourne
Fluorite | Level 6
Wow, that's so wonderful! Thank you all for the help. Now I know several ways to clear the SAS logs 🙂

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 38426 views
  • 2 likes
  • 6 in conversation