How to get table size using proc sql

Reply
Contributor
Posts: 30

How to get table size using proc sql

Hi  Experts,

Could you please tell me the proc sql query in SAS  that will output the size of a table(in MB or GB)  in SAS ?

Super User
Posts: 5,429

Re: How to get table size using proc sql

Posted in reply to VijayKumar

By querying the SAS dictionary, you could get a approximate figure.

If the table is compressed, or has index, it's getting a bit more complex.

If you have tables in BASE engine you could read the OS information, pipe it back to (but this wouldn't be SQL).

Data never sleeps
Super User
Posts: 5,429

Re: How to get table size using proc sql

Sorry, forget sample code:

proc sql;

create table tab as

select libname, memname, nobs, obslen, nobs*obslen as Bytes

from dictionary.tables

where libname='YOURLIB';

quit;

Data never sleeps
Super User
Super User
Posts: 7,050

Re: How to get table size using proc sql

Posted in reply to VijayKumar

proc sql ;

  select libname,memname,filesize,pcompress

  from dictionary.tables

;

quit;

Ask a Question
Discussion stats
  • 3 replies
  • 2335 views
  • 2 likes
  • 3 in conversation