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 ?
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).
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;
I want to know how to calculate the file size if the table has index. Could you help me, please?
proc sql ;
select libname,memname,filesize,pcompress
from dictionary.tables
;
quit;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.