I create a big dataset in SAS. Every time I run the sas programs, I notice that it takes about 50GB of my local disk space. So I always remove sas temporary files each time I quit sas session. I usually do a search under C:\ drive, and sas temporary files will pop up. However, I cannot locate the file after I quit sas session today, and local disk space goes down to 49.3GB from 103GB after I modified this sas program. Any idea how to find this sas temporary file? Thanks!
Where is the WORK library normally allocated? For example, my WORK location is X:\saswork with a auto generated sub folder.
You can find out your work lib location by running:
Proc OPTIONS OPTION=WORK;
RUN;
If you determine the high level folder, then close all SAS sessions, any sub folders that remain are "orphans", and you can delete them (and their contents) which should free up space.
You could still have utility files left, but Work is the first place to start.
Jim
Yes I am running on Windows. I did empty recycle bin but that did not help with disk cleanup.
Where is the WORK library normally allocated? For example, my WORK location is X:\saswork with a auto generated sub folder.
You can find out your work lib location by running:
Proc OPTIONS OPTION=WORK;
RUN;
If you determine the high level folder, then close all SAS sessions, any sub folders that remain are "orphans", and you can delete them (and their contents) which should free up space.
You could still have utility files left, but Work is the first place to start.
Jim
Thanks for your response. I am able to locate sas temporary files using the sas codes in your response. I deleted all files under this temporary folder and free up about 55 GB disk space.
Another way to identify WORK (or any other SAS library) path is by using PATHNAME() function:
%let workpath = %sysfunc(pathname(WORK));
%put &=workpath;
This way you also capture this path into macro variable.
Or you can write it into a SAS data table for further processing:
data LOCATOR;
length workpath $200;
workpath = pathname('WORK');
run;
Thanks!
SAS's default behaviour is to remove your SAS WORK folder, including its contents, when you close your SAS session. Are you not seeing that happen?
The files in the work library are removed each time I quit sas session. But apparently they are saved somewhere on the hard drive.
In your library list, right-click on WORK and let it display Properties. This will lead you to the root path for your WORK directories, so you can navigate there with Windows Explorer and manually remove all remnants from previous sessions.
Did you, at some point in your program, define a USER library?
I usually do not define a user library, always use work library. I try to save disk space, and avoid running datasets placed on network drive.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.