SAS list and store all tables name under specify library to a table

不羁岁月 提交于 2019-12-26 12:31:45

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!