问题
Under library "testing", i have 5 datasets. How can i list all tables names?
proc datasets lib = work; quit; run;
While i would like to have further usage of the information. like the tables name.
Thanks
回答1:
Use the SQL dictionary.tables view...
proc sql ; create table mytables as select * from dictionary.tables where libname = 'WORK' order by memname ; quit ;
回答2:
Proc sql;
select *
from sashelp.vmember
where libname = "TESTING"
;
quit;
Make sure to put the library name in upper case.
回答3:
The answers above are correct but it can often take a long time to build the sashelp.vmember or dictionary.tables files.
This will have better performance especially on the first run.
proc contents data=testing._all_;
ods select members;
run;
回答4:
More likely the user wants this solution which is quick and creates the table:
proc contents data=testing._ALL_;
ods output members=work.temp;
run;
来源:https://stackoverflow.com/questions/27012681/sas-list-and-store-all-tables-name-under-specify-library-to-a-table