Is it possible to clear results programmatically in SAS-EG?
I would like to clear all results at the start of the project (or process flow)
I don't think that you can, but please make your question more specific
results as in "reports"
results as in "data from queries"
If you delete all results, you will often break links and end up with a real mess to clean up.
"Results" as in output of procedures that you can view on the screen -- on the Results tab of a program -- specifically results of the proc print
Also I would like to clear the log -- make it look like the step never ran -- which is realistic at the start of the project.
I'm able to delete the output from queries -- I can delete the temporary data sets using DATASETS KILL... at the beginning of the project. This keeps the objects in the project, but their data is really gone... which is good.
In Base SAS, I can say: DM OUT 'CLEAR';
Can I do something similar for the Results window in SAS-EG ?
I would like to clear all the results at the beginning of my project because I have some conditional steps that sometimes don't execute, and I don't want to see the results of previous runs in those steps.
Currently, I put a date-time stamp in the log, but I'd rather not see the output/results at all.
I guess I could use a macro variable with the values {"current","old"}, set this variable to "old" at the beginning of the project and then set it to "new" during the execution of this project and display this variable in the title of the results, but I would need a dozen such variables -- one for every step... looking for a more efficient solution.
As far as I am aware there is no command interface in EG to allow your program to do EG "housekeeping". If I'm running regular jobs I tend to schedule these as SAS batch jobs. The great thing about batch jobs is they have their own session, own log, and own output if you timestamp the files.
You can stop the resulting datasets from appearing in EG by ...
Menu tools / options - opens a window
Then on the left select Results General, on the right hand side make sure "Automatically add output data to the project tree" is unticked.
Thank you for considering my predicament.
This suggestion might be useful for someone else, but in my case I already had "Automatically add output data to the project tree" unchecked. This option is useful for keeping the output data out of the project tree, but I'm looking for a way to clear results (and the log) behind every program-step at the start of running the whole project. The purpose is to prevent mistaking old results for new results. I have some conditional steps in my project that sometimes don't execute. Unfortunately the old results are still there, so it looks like the step executed until I look at the date-time stamp and see that it's old.
For an easy overview of which tasks ran at what date/time, try the Project Reviewer custom task:
How much time will your process flow take to run? - The SAS Dummy
Chris
Tanks, Chris
The Project Reviewer does look useful -- I can sort by the last modified date to see what didn't run in the expected order. If it's not in the expected order, then it didn't run in the most recent flow.
I submitted an idea with a similar name: SAS-EG Clear Results Programmatically
Please vote
I have found a way to clear results.
1. Copy the old program.
2. Create a new program.
3. Paste the program.
4. Delete the old program.
I agree that there should be a better way.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.