Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

list ALL library name in SAS LIBRARIES

Tags:

sas

I would like to search a sas data sets with name include "Loan".

If i know the specific library i can do it by proc datasets

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

(afterward i will select those memname contains "loan" using index function)

I would like to change the line library = work to library = _all_ While it file to access the library information. Is there any alternative way to achieve the task?

like image 814
useR Avatar asked Dec 31 '25 21:12

useR


1 Answers

Use the SASHELP.VTABLE view. It lists all tables in all libraries

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

or

data search;
   set sashelp.vtable;
   if index(upcase(memname),'LOAN');
run;
like image 179
DomPazz Avatar answered Jan 04 '26 11:01

DomPazz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!