How can I easy create storage/size in memeory information of all tables in a specific cas lib.
I use this:
proc cas;
table.tabledetails /name="%" caslib="XXXX";
quit;
but it fails. it seems that I can not use a wildcards in that manner?
Do you have some code which could help me?
cas mycas;
libname casuser cas caslib=casuser;
proc casutil;
load data=sashelp.cars
outcaslib="casuser"
casOut="cars"
replace;
load data=sashelp.class
outcaslib="casuser"
casOut="class"
replace;
load data=sashelp.baseball
outcaslib="casuser"
casOut="baseball"
replace;
run;
proc cas;
table.tableinfo result=rc /caslib="casuser";
fragment=';';
do table over rc["TableInfo"][,"Name"];
table.tabledetails result=result/name=table caslib="casuser";
saveresult result caslib="casuser" casout=table;
code="data casuser.allResults"||fragment|| "set casuser."||table||";length Data varchar(100);Data='"||table||"';run;";
datastep.runcode/code=code;
fragment='(append=yes);';
end;
quit;
Give this a try
proc casutil;
load data=sashelp.cars
outcaslib="casuser"
casOut="cars"
replace;
load data=sashelp.class
outcaslib="casuser"
casOut="class"
replace;
load data=sashelp.baseball
outcaslib="casuser"
casOut="baseball"
replace;
run;
proc cas;
table.tableinfo result=rc /caslib="casuser";
do table over rc["TableInfo"][,"Name"];
table.tabledetails /name=table caslib="casuser";
end;
quit;
Can you try this?
It works perfectly - thanks a lot. Is it possible to output the results in a table? thanks in advance.
I would prefer one table as it can be used for a report afterwards. Thanks in advance.
cas mycas;
libname casuser cas caslib=casuser;
proc casutil;
load data=sashelp.cars
outcaslib="casuser"
casOut="cars"
replace;
load data=sashelp.class
outcaslib="casuser"
casOut="class"
replace;
load data=sashelp.baseball
outcaslib="casuser"
casOut="baseball"
replace;
run;
proc cas;
table.tableinfo result=rc /caslib="casuser";
fragment=';';
do table over rc["TableInfo"][,"Name"];
table.tabledetails result=result/name=table caslib="casuser";
saveresult result caslib="casuser" casout=table;
code="data casuser.allResults"||fragment|| "set casuser."||table||";length Data varchar(100);Data='"||table||"';run;";
datastep.runcode/code=code;
fragment='(append=yes);';
end;
quit;
Give this a try
it works great. Thank you so much for your help. I am very happy with your solution.
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 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.
Ready to level-up your skills? Choose your own adventure.