Need to measure space occupied by SAS data sets in a given directory(x) and need to generate report every day in excel or email??
Obstacle: dont have permission to read every sub directory under given directory (x)?
But have sudo privileges in command prompt to a given directory (x).
Q) Can we done this task using SAS management console?
or
Using scripting only?
Any literature appreciated.
I saw some paper or tip to do this in SAS.com Now not able to find that paper or tip. Share if you have that paper.
Thanks.
One way to find the details of space occupied by sas datset by using "PROC CONTENTS".
Refer below sample code which may help you.
Libname Test "<PATH>";
Proc Contents DATA=Test._all_ nods;
run;
What engine are you using ?
If BASE then you can query the dictionary table like above did.
If SPDS then you can use command du -g .
In dictionary.tables, there is also a column specifying level compression, which can be used in the calculation.
If you have table in place deletions, beware to use no of physical observations.
What is missing here is size information of indexes, which could be complicated to calculate.
So, bottom line, using OS tools is preferable if you need a result close as possible to the "truth".
Still looking for effecient answers.
The efficient way is to use OS command as Linux did .
What engine are you using .BASE engine can query dictionary table to find out the size , but SPDS can't .
The attachement is a paper I wrote for SGF next year. But it is still not adopted .Hope it can help you a little bit. I used OS command to get SPDS library's size ,very fast. you can try it.
Ksharp
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.