<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Creating a table containing all fields of all tables inside a library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816468#M322277</link>
    <description>&lt;PRE&gt;Proc SQL;
    create table want as
    select libname, memname, name
    from dictionary.columns
    where libname='WORK' and memtype='DATA'
    ;
quit;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;data otherwant;
   set sashelp.vcolumn;
   where libname='WORK' and memtype='DATA';
run;
&lt;/PRE&gt;
&lt;P&gt;SAS keeps all that metadata in special data views in the SASHELP library. You can look at them with any tool you like. The Proc SQL treats them as members of a special set of members in the DICTIONARY (note that is not really a library&amp;nbsp; as more than 8 characters) that has different members that contain information about data variables (columns), data sets, libraries, external files, macros, title statements and more.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2022 23:04:40 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-06-03T23:04:40Z</dc:date>
    <item>
      <title>Creating a table containing all fields of all tables inside a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816459#M322268</link>
      <description>&lt;P&gt;Hello. I would like to find a function/statement that extracts all field names of a table. Then I would like to iterate it over all existing tables within a library and list them in a dataset like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TABLE | FIELD&lt;/P&gt;&lt;P&gt;table 1 | field 1&lt;/P&gt;&lt;P&gt;table 1 | field 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/P&gt;&lt;P&gt;table 1 | field m&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;...&lt;/P&gt;&lt;P&gt;table 2 | field 1&lt;/P&gt;&lt;P&gt;table 2 | field 2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...&lt;/P&gt;&lt;P&gt;table n | field m&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 22:02:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816459#M322268</guid>
      <dc:creator>endomorph-21</dc:creator>
      <dc:date>2022-06-03T22:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table containing all fields of all tables inside a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816461#M322270</link>
      <description>&lt;P&gt;Just use PROC CONTENTS.&lt;/P&gt;
&lt;P&gt;So if your libref is LIBREF then this code will make a dataset named WANT with one observation per variable per dataset (member).&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC CONTENTS data=libref._all_ out=WANT; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Add NOPRINT option to the PROC statement if you don't need to see the contents printed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 22:09:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816461#M322270</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-06-03T22:09:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table containing all fields of all tables inside a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816468#M322277</link>
      <description>&lt;PRE&gt;Proc SQL;
    create table want as
    select libname, memname, name
    from dictionary.columns
    where libname='WORK' and memtype='DATA'
    ;
quit;&lt;/PRE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;data otherwant;
   set sashelp.vcolumn;
   where libname='WORK' and memtype='DATA';
run;
&lt;/PRE&gt;
&lt;P&gt;SAS keeps all that metadata in special data views in the SASHELP library. You can look at them with any tool you like. The Proc SQL treats them as members of a special set of members in the DICTIONARY (note that is not really a library&amp;nbsp; as more than 8 characters) that has different members that contain information about data variables (columns), data sets, libraries, external files, macros, title statements and more.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2022 23:04:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-containing-all-fields-of-all-tables-inside-a/m-p/816468#M322277</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-06-03T23:04:40Z</dc:date>
    </item>
  </channel>
</rss>

