BookmarkSubscribeRSS Feed
smm662002
Quartz | Level 8

Hello,

 

Can anybody advise which is the most accurate method to get the size of a table in CAS?

 

Thank you,

Madalin

4 REPLIES 4
smm662002
Quartz | Level 8
Hi Eyal,

Thank you for your reply.
CAS action table.tableDetails provides two useful columns "Data size" and "Variable Data size".
Would you know if table size is the sum of "Data size" and "Variable Data size"?

Thank you,
Madalin
miaeyg
Fluorite | Level 6

Hi @smm662002 

 

Yes, I believe you need to sum the two. One if "fixed" size columns and the other is "variable" sized columns like varchar.

 

HTH,

Eyal

AmrAlmaz
SAS Employee

Here you go.

/*Set without quotations the libname variable to the library name and the dsname variable to the dataset name which you want to inquire about it's size*/
%let libname=?;
%let dsname=?;
 
/*Initiate CAS session*/
cas;
 
/*Use table.tabledetails to get the table size and save the result to work.cas_ds_memsize dataset*/
proc cas;
table.tabledetails result=res/ caslib="&libname." NAME="&dsname." showmem=true;
saveresult res dataout=work.cas_ds_memsize;
quit;
 
/*Query work.cas_ds_memsize dataset to display the size in megabyte (MB)*/
proc sql;
select 
"&libname." as CAS_Library_Name,
"&dsname." as CAS_Dataset_Name,
(mem.MappedMemory/1024/1024) format=8.2 as Memsize_MB
from 
work.cas_ds_memsize mem
;
quit;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Discussion stats
  • 4 replies
  • 4127 views
  • 0 likes
  • 3 in conversation