☑ This topic is solved.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 04-29-2024 09:02 AM
(1427 views)
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?
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
6 REPLIES 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It works perfectly - thanks a lot. Is it possible to output the results in a table? thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Yes -
We can use the saveresult statement to do this.
Do you want them appended to one table or a different table for each?
We can use the saveresult statement to do this.
Do you want them appended to one table or a different table for each?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I would prefer one table as it can be used for a report afterwards. Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
it works great. Thank you so much for your help. I am very happy with your solution.