<?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: All_Tables or All_Columns in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182328#M13974</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid I don't have an oracle background, but here's a suggestion by using a macro loop approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Define a macro to loop for your filters through;&lt;/P&gt;&lt;P&gt;%macro&amp;nbsp; tablexctract (tbl_filter=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Open the Library and keep the table names that meet the "WHERE MEMNAME=" criteria;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc sql; &lt;/P&gt;&lt;P&gt;&amp;nbsp; create table Library_content&lt;/P&gt;&lt;P&gt;&amp;nbsp; as select &lt;/P&gt;&lt;P&gt;&amp;nbsp; memname as Dataset_Name&lt;/P&gt;&lt;P&gt;&amp;nbsp; , *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from Dictionary.tables &lt;/P&gt;&lt;P&gt;&amp;nbsp; where LIBNAME='&lt;EM&gt;your libname here&lt;/EM&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp; and MEMTYPE='DATA'&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; and memname like "%&amp;amp;tbl_filter.%"&amp;nbsp;&amp;nbsp; /** Additional "where" condition ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ;quit; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Put the results into a macro variable.&amp;nbsp; Caution - this approach relies on a single table name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; being returned from the filter above */&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set work.library_contentmaps (obs=1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('tblname',dataset_name);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table NEW_table_&amp;amp;tbl_filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp; as select &lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from &amp;amp;tblname.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Use the macro parameter TBL_FILTER to define the table name content you woudl like to extract;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(emp); * loop 1;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 2;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 3;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 4;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A very different approach would require you to research the autocall macro functionality, see &lt;SPAN style="text-decoration: underline;"&gt;%sysfunc&lt;/SPAN&gt; examples 4 &amp;amp; 5 on this link:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Jan 2015 13:45:36 GMT</pubDate>
    <dc:creator>RB1Kenobi</dc:creator>
    <dc:date>2015-01-14T13:45:36Z</dc:date>
    <item>
      <title>All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182323#M13969</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;How to find all the sas tables or library or other metadata information?. In Oracle we have tables like All_Tables or All_Tab_columns and many others.I checked with dictionary table present in sas like vtable or vslib but I couldn't find all the library or tables except some sas predefined metadata.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 11:16:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182323#M13969</guid>
      <dc:creator>Tanmoy</dc:creator>
      <dc:date>2015-01-14T11:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182324#M13970</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In PROC SQL, access the DISCTIONARY.-tabels. See PROC SQL doc for details.&lt;/P&gt;&lt;P&gt;For other tools, there are corresponding VIEWs in SASHELP library.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 11:24:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182324#M13970</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2015-01-14T11:24:56Z</dc:date>
    </item>
    <item>
      <title>Re: All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182325#M13971</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I hope I've understood your question correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Option 1 - see the contents of a defined library:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;proc sql; &lt;/P&gt;&lt;P&gt;&amp;nbsp; create table Library_content&lt;/P&gt;&lt;P&gt;&amp;nbsp; as select &lt;/P&gt;&lt;P&gt;&amp;nbsp; memname as Dataset_Name&lt;/P&gt;&lt;P&gt;&amp;nbsp; , *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from Dictionary.tables &lt;/P&gt;&lt;P&gt;&amp;nbsp; where LIBNAME='&lt;EM&gt;YOUR LIBNAME HERE&lt;/EM&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp; and MEMTYPE='DATA' &lt;/P&gt;&lt;P&gt;;quit; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Option 2;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Try&lt;STRONG&gt; Proc Contents &lt;/STRONG&gt;to explore individual tables&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc contents data=libname.tablename;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 12:05:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182325#M13971</guid>
      <dc:creator>RB1Kenobi</dc:creator>
      <dc:date>2015-01-14T12:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182326#M13972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Linus and RB1Kenobi for your answer but my case is diff...by firing the query mentioned by Kenobi, I can get the table content. But that's not what I need. I am building an automatic code where if you know or don't know the table name. If you give like statement ,it will fetch the table name and it will be used as a source table for the target. In oracle it could be somewhat like this.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select table_name from all_tables where table_name like '%emp%'&lt;/P&gt;&lt;P&gt;-----output : 5 row with table name have been received.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop 1..max_count(in this case it is 5)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert into target_table select a.col1,a.col2 from &amp;amp;table_name&lt;/P&gt;&lt;P&gt;----- the loop will be executed 5 times and for 5 diff table data will be inserted in the target table....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope I have illustrated my situation vividly..:)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 13:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182326#M13972</guid>
      <dc:creator>Tanmoy</dc:creator>
      <dc:date>2015-01-14T13:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182327#M13973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use call execute()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
data _null_;
 set sashelp.vmember(where=(libname='SASHELP' and memname like '%CLASS%' and&amp;nbsp; MEMTYPE='DATA')) end=last;
 if _n_ eq 1 then call execute('proc sql;');
 call execute('insert into target_table select * from '||cats(libname,'.',memname)||';');
 if last then call execute('quit;');
run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 13:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182327#M13973</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-14T13:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182328#M13974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm afraid I don't have an oracle background, but here's a suggestion by using a macro loop approach.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Define a macro to loop for your filters through;&lt;/P&gt;&lt;P&gt;%macro&amp;nbsp; tablexctract (tbl_filter=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; * Open the Library and keep the table names that meet the "WHERE MEMNAME=" criteria;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc sql; &lt;/P&gt;&lt;P&gt;&amp;nbsp; create table Library_content&lt;/P&gt;&lt;P&gt;&amp;nbsp; as select &lt;/P&gt;&lt;P&gt;&amp;nbsp; memname as Dataset_Name&lt;/P&gt;&lt;P&gt;&amp;nbsp; , *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from Dictionary.tables &lt;/P&gt;&lt;P&gt;&amp;nbsp; where LIBNAME='&lt;EM&gt;your libname here&lt;/EM&gt;'&lt;/P&gt;&lt;P&gt;&amp;nbsp; and MEMTYPE='DATA'&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; and memname like "%&amp;amp;tbl_filter.%"&amp;nbsp;&amp;nbsp; /** Additional "where" condition ***/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; ;quit; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; /* Put the results into a macro variable.&amp;nbsp; Caution - this approach relies on a single table name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; being returned from the filter above */&lt;/P&gt;&lt;P&gt;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set work.library_contentmaps (obs=1);&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('tblname',dataset_name);&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table NEW_table_&amp;amp;tbl_filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp; as select &lt;/P&gt;&lt;P&gt;&amp;nbsp; *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from &amp;amp;tblname.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Use the macro parameter TBL_FILTER to define the table name content you woudl like to extract;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(emp); * loop 1;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 2;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 3;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 4;&lt;/P&gt;&lt;P&gt;%tablexctract(tbl_filter=%str(...); * loop 5;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A very different approach would require you to research the autocall macro functionality, see &lt;SPAN style="text-decoration: underline;"&gt;%sysfunc&lt;/SPAN&gt; examples 4 &amp;amp; 5 on this link:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p1o13d7wb2zfcnn19s5ssl2zdxvi.htm&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 13:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182328#M13974</guid>
      <dc:creator>RB1Kenobi</dc:creator>
      <dc:date>2015-01-14T13:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: All_Tables or All_Columns</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182329#M13975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks guys!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 13:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/All-Tables-or-All-Columns/m-p/182329#M13975</guid>
      <dc:creator>Tanmoy</dc:creator>
      <dc:date>2015-01-14T13:58:20Z</dc:date>
    </item>
  </channel>
</rss>

