Suppose you sit down at your recently-started computer, fire up a SAS session. Before you run those procedures you want to run, look at the computer screen. SAS is clean, log just shows the few introductory items, Output empty, Results empty, Results Viewer empty. All set to go.
Question is: Is there any way to get back to this point without having to exit and restart SAS????
Programmatically, like, reset this, reset that. Presto.
Possible solutions greatly appreciated!!
Nicholas
@NKormanik wrote:
Let's assume 100 sets of procedures. We want all executed. Want to save the log, output, ODS html for each of the distinct sets, to study later.
For each set of procedures it would be best to start afresh, so no leftovers exist from the previous round.
We could exit SAS between each iteration. Save results. Start SAS again for the next round.
But it would be nice if we could do a reset between the iterations, and keep going in one session.
Or Proc Printto to write the log starting at a desired point to a different file, ODS HTML or other ODS destination with file/ close to write output to different destination.
Let's assume 100 sets of procedures. We want all executed. Want to save the log, output, ODS html for each of the distinct sets, to study later.
For each set of procedures it would be best to start afresh, so no leftovers exist from the previous round.
We could exit SAS between each iteration. Save results. Start SAS again for the next round.
But it would be nice if we could do a reset between the iterations, and keep going in one session.
Run them as separate SAS sessions.
If you have SAS/Connect you could do it using SIGNON and RSUBMIT.
The one useful command for this that I have found recently is the
resetline;
statement.
That will reset the line numbers that display in the SAS log back to 1. Example:
135 resetline; 1 proc means data=sashelp.class; run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. 2 resetline; 1 proc means data=sashelp.cars; run; NOTE: There were 428 observations read from the data set SASHELP.CARS.
@NKormanik wrote:
Let's assume 100 sets of procedures. We want all executed. Want to save the log, output, ODS html for each of the distinct sets, to study later.
For each set of procedures it would be best to start afresh, so no leftovers exist from the previous round.
We could exit SAS between each iteration. Save results. Start SAS again for the next round.
But it would be nice if we could do a reset between the iterations, and keep going in one session.
Or Proc Printto to write the log starting at a desired point to a different file, ODS HTML or other ODS destination with file/ close to write output to different destination.
No, you can't. Just consider 2 questions:
1. Can you reset all system options to the default value?
2. How to reset some read-only system macro variable, like syserrortext?
We are just talking about very basic condition, file system can be more impossible, what if programmer delete a table in sashelp?
I think it's important to define the scope of the reset. To me, "resetting SAS" implies a fresh SAS session (empty work library, no user-created macro variables, no user librefs assigned, etc etc.) .
Are you really only interested in clearing the log window and results window?
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.