Curious if it's good practice to give some command for SAS to recover (reset, stabilize, recoup) following an involved proc statement.
In other words, suppose some proc statement execution takes 10 minutes to complete.
Before issuing another proc statement (via batch set of commands) is there a way to tell SAS to take a break -- relax, regain all your memory parts, clean up your temp files, recover -- prior to moving on to the next proc statement.
If so, what is that "take-a-break" command?
Any thoughts appreciated.
Thanks,
Nicholas Kormanik
When a step finishes, all the resources it used internally are cleaned up. Libnames or file references that you defined before the step will still be active, and some things created by a step (e.g. macro variables through CALL SYMPUT, or file references through the FILENAME function) also.
I have no in-depth knowledge if SAS keeps file data in buffers after use (e.g. a dataset created by the step) for the purpose of fast access if the dataset is used again immediately; if it does, this might explain a larger RAM footprint after execution of a step.
Bottom line: there is no need for such housekeeping, if you suspect a "memory leak", bring it to the attention of SAS technical support.
When a step finishes, all the resources it used internally are cleaned up. Libnames or file references that you defined before the step will still be active, and some things created by a step (e.g. macro variables through CALL SYMPUT, or file references through the FILENAME function) also.
I have no in-depth knowledge if SAS keeps file data in buffers after use (e.g. a dataset created by the step) for the purpose of fast access if the dataset is used again immediately; if it does, this might explain a larger RAM footprint after execution of a step.
Bottom line: there is no need for such housekeeping, if you suspect a "memory leak", bring it to the attention of SAS technical support.
Yeah, that's one thing to have an eye on. Housekeeping in WORK can become essential when working with large datasets.
@NKormanik wrote:
Good to know, Kurt. Thanks so much for your thorough, well-informed reply. As well as being so fast to respond.
Some minor things to consider cleaning up/resetting:
Title/Footnote statements since these persist.
System or graphic options that may be needed temporarily such as page orientation, missing character option, graph area size settings.
Not so much for resources as to ensure that output created is as expected.
@Kurt_Bremser is right about that. However, there is one additional resource you may want to consider: cleaning up the WORK space.
If your long-running program creates temporary data sets in the WORK library, it would be possible to run out of WORK space. You can remove temporary data sets that are no longer needed by using PROC DATASETS or PROC DELETE.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.