Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SAS – Can I create a table of all table names within a library and then all variables within those tables?

I would like to create a new table with all tables contained within a library and the variables within each of those tables. I know I can use something like the below to get the table name but I cant find much on getting each variable. I have multiple libraries and each has potentially hundreds of tables. Any help really appreciated.

proc sql ;
  create table mytables as
  select *
  from dictionary.tables
  where libname IN ('WORK','SPDSWORK',etc)
  order by memname ;
quit ;

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Use distionary.columns instead.

proc sql ;
  create table mytables as
  select *
  from dictionary.columns
  where libname IN ('SASHELP')
  order by memname ;
quit ;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading