BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NKormanik
Barite | Level 11

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@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.

View solution in original post

6 REPLIES 6
LinusH
Tourmaline | Level 20
Assuming DMS SAS.
Restarting a SAS session takes less than a second, so I'm not sure what you want to achieve? Is there something in the current session that you don't want to reset?
In SAS Studio there's a reset options, but that in turn fires an ENDSAS statement, practically the same as restarting SAS (but in Studio you don't have to close the window).
Data never sleeps
NKormanik
Barite | Level 11

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.

Tom
Super User Tom
Super User

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.

 

ballardw
Super User

@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.

whymath
Lapis Lazuli | Level 10

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?

Quentin
Super User

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?


The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.

sas-innovate-white.png

Missed SAS Innovate in Orlando?

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.

 

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 701 views
  • 5 likes
  • 6 in conversation
OSZAR »