<?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: How to store existing datasets names into variables? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430167#M106328</link>
    <description>&lt;P&gt;Or use a naming convention. Name all your temporary datasets with _CombinedA, _CombinedB etc&lt;/P&gt;
&lt;P&gt;Then when you’re trying to combine the data you can use the wildcard : to set the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set _combined: ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
    <pubDate>Tue, 23 Jan 2018 20:53:19 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-01-23T20:53:19Z</dc:date>
    <item>
      <title>How to store existing datasets names into variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430152#M106319</link>
      <description>&lt;P&gt;I have macro which creates multiple datasets and not always the same datasets are created. How can I keep only existing datasets names into a SAS variable and SET all of them together?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt; A;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A=&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Data&lt;/STRONG&gt; C;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C=&lt;STRONG&gt;1&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;/*Here we will have an error as the dataset B does not exist*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; All_Data;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set a b c;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#008000"&gt;/*My idea was storage all the existing datasets (A and C) and do something like this*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; All_Data;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set &amp;amp;existing_datasets.;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do I read the existing datasets and store their names into a variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 20:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430152#M106319</guid>
      <dc:creator>danfavero</dc:creator>
      <dc:date>2018-01-23T20:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to store existing datasets names into variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430155#M106322</link>
      <description>&lt;P&gt;query dictionary tables into maco var and call the macrovar in set statements- your safe bet&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 20:31:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430155#M106322</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-23T20:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to store existing datasets names into variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430161#M106326</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select memname into :dsnlist separated by ' '
from sashelp.vtable /*or dictionary.tables*/
where libname='YOUR_LIBNAME';/*your lib where the datasets are stored */
quit;

data want;
set &amp;amp;dsnlist;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Jan 2018 20:38:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430161#M106326</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-01-23T20:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to store existing datasets names into variables?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430167#M106328</link>
      <description>&lt;P&gt;Or use a naming convention. Name all your temporary datasets with _CombinedA, _CombinedB etc&lt;/P&gt;
&lt;P&gt;Then when you’re trying to combine the data you can use the wildcard : to set the data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set _combined: ;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jan 2018 20:53:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-store-existing-datasets-names-into-variables/m-p/430167#M106328</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-01-23T20:53:19Z</dc:date>
    </item>
  </channel>
</rss>

