列出SAS LIBRARIES中的所有库名称

时间:2015-01-14 02:43:06

标签: sas

我想搜索一个名为“Loan”的sas数据集。

如果我知道特定的库,我可以通过proc datasets

来完成
proc datasets
    library = work
    memtype = data;
    contents
        data = _all_ (keep = libname memname name)
        out = work.table_name;
quit;
run;

(之后我将使用index函数选择那些memname包含“loan”)

我想将行library = work更改为library = _all_ 虽然它提交文件来访问库信息。有没有其他方法可以完成任务?

2 个答案:

答案 0 :(得分:7)

使用SASHELP.VTABLE视图。它列出了所有库中的所有表

proc sql noprint;
   create table search as
      select * from sashelp.vtable
         where upcase(memname) like '%LOAN%';
quit;

data search;
   set sashelp.vtable;
   if index(upcase(memname),'LOAN');
run;

答案 1 :(得分:3)

您可以使用SAS的“词典”表格来查找此类清单,您可以搜索数据集名称,列名称等

proc sql;
   create table mytable as
      select * from sashelp.vtable
      where upcase(memname) like '%LOAN%';
quit;

例如: -

 VCATALG Provides information about SAS catalogs.
 VCOLUMN Provides information about column in tables.
 VEXTFL Provides information related to external files.
 FORMATS Provides information related to defined formats and informats.
 VINDEX Provides information related to defined indexes.
 VMACRO Provides information related to any defined macros.
 VOPTION Provides information related to SAS system options.
 VTABLE Provides information related to currently defined tables.
 VTITLE Provides information related to currently defined titles and footnotes.
 VVIEW Provides information related to currently defined data views.

http://support.sas.com/documentation/cdl/en/lrcon/67885/HTML/default/viewer.htm#p00cato8pe46ein1bjcimkkx6hzd.htm

http://support.sas.com/documentation/cdl/en/lrcon/65287/HTML/default/viewer.htm#p00cato8pe46ein1bjcimkkx6hzd.htm

https://v8doc.sas.com/sashtml/proc/zsqldict.htm