Help using Base SAS procedures

measuring space occupied by sas data sets in a given directory???

Reply
Frequent Contributor
Posts: 110

measuring space occupied by sas data sets in a given directory???

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.

Occasional Contributor
Posts: 5

Re: measuring space occupied by sas data sets in a given directory???

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;

Super User
Posts: 9,682

Re: measuring space occupied by sas data sets in a given directory???

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 .

Super User
Posts: 5,257

Re: measuring space occupied by sas data sets in a given directory???

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

Data never sleeps
Frequent Contributor
Posts: 110

Re: measuring space occupied by sas data sets in a given directory???

Still looking for effecient answers.

Super User
Posts: 9,682

Re: measuring space occupied by sas data sets in a given directory???

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

Ask a Question
Discussion stats
  • 5 replies
  • 283 views
  • 0 likes
  • 4 in conversation