<?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 Concatenate ALL the data sets in a particular reference library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622981#M183305</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data concatenation;
   set animal plant;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Given a long list of SAS data sets, I would prefer to use a "data set list".&amp;nbsp; Apparently in order to do so, the data sets have to begin with the same character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: set library.a: ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose all data sets have different starting characters.&amp;nbsp; And I'd rather not rename them all, so as to have a common first character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Combine (stack, concatenate) &lt;STRONG&gt;ALL&lt;/STRONG&gt; the data sets in this particular 'library', please....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suggestions or thoughts greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a Proc SQL equivalent that I could use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Feb 2020 09:37:49 GMT</pubDate>
    <dc:creator>NKormanik</dc:creator>
    <dc:date>2020-02-07T09:37:49Z</dc:date>
    <item>
      <title>Concatenate ALL the data sets in a particular reference library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622981#M183305</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data concatenation;
   set animal plant;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Given a long list of SAS data sets, I would prefer to use a "data set list".&amp;nbsp; Apparently in order to do so, the data sets have to begin with the same character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example: set library.a: ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suppose all data sets have different starting characters.&amp;nbsp; And I'd rather not rename them all, so as to have a common first character.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Combine (stack, concatenate) &lt;STRONG&gt;ALL&lt;/STRONG&gt; the data sets in this particular 'library', please....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Suggestions or thoughts greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a Proc SQL equivalent that I could use?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nicholas Kormanik&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 09:37:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622981#M183305</guid>
      <dc:creator>NKormanik</dc:creator>
      <dc:date>2020-02-07T09:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate ALL the data sets in a particular reference library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622988#M183308</link>
      <description>&lt;P&gt;Use proc sql select into from dictionary.tables:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select memname into : dslist separated by ' '
from dictionary.tables
where libname = "YOURLIB"; /* capitals here! */
quit;

data want;
set &amp;amp;dslist.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 09:53:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622988#M183308</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-02-07T09:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Concatenate ALL the data sets in a particular reference library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622992#M183313</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/22691"&gt;@NKormanik&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can get the dataset names from sashelp.vtable. Get all names within the wanted library in a data step and use the list to create another data step and execute it. Following code is tested and works as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let inlibref = work;
%let concatds = work.all; 
data _null_; 
	set sashelp.vtable (where=(libname=upcase("&amp;amp;libref"))) end=eod; 
	length str $32000;
	retain str "data &amp;amp;concatds; set";
	str = catx(' ',str,memname);
	if eod then do;
		str = catx(' ',str,'; run;');
		call execute(str);
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Feb 2020 09:57:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Concatenate-ALL-the-data-sets-in-a-particular-reference-library/m-p/622992#M183313</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2020-02-07T09:57:50Z</dc:date>
    </item>
  </channel>
</rss>

