<?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: Can SAS do this when merging datasets? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306926#M270589</link>
    <description>&lt;P&gt;You can filter in a data step merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you merging datasets side by side, or appending (stacking datasets on top of each other)?&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2016 19:31:55 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-10-24T19:31:55Z</dc:date>
    <item>
      <title>Can SAS do this when merging datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306914#M270588</link>
      <description>&lt;P&gt;have around 100 datasets that contains 30 stocks.Now, I have to open each dataset manually and merge them if they contain same stock. This is really time-consuming. So I want to ask whether I could use some codes to achieve this (merge datasets based on certain requirements).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;p.s. each dataset has a variable called RIC that could identify what the stock (e.g AXP and BP) is involved in this dataset.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 18:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306914#M270588</guid>
      <dc:creator>Neal0801</dc:creator>
      <dc:date>2016-10-24T18:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Can SAS do this when merging datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306926#M270589</link>
      <description>&lt;P&gt;You can filter in a data step merge.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you merging datasets side by side, or appending (stacking datasets on top of each other)?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:31:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306926#M270589</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-24T19:31:55Z</dc:date>
    </item>
    <item>
      <title>Re: Can SAS do this when merging datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306937#M270590</link>
      <description>&lt;P&gt;If you are stacking, adding data set one after the other, and the data set names are somewhat common, such as all start with the same 5 characters you could do something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; set mylib.ABCDE: ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; where RIC in ('AXB', 'BP');&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The : at the end says to read all the sets that start with ABCDE in the name that are in library MYLIB.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;If you have a few different stems then have all of them on the set statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set mylib.ABCDE:&amp;nbsp;&amp;nbsp; mylib.PDQ: ;&lt;/P&gt;
&lt;P&gt;The sets could even be in multiple libraries.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:55:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306937#M270590</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-10-24T19:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can SAS do this when merging datasets?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306941#M270591</link>
      <description>&lt;P&gt;There are some points to clarify:&lt;/P&gt;
&lt;P&gt;1) is there a stock_id in each dataset ?&lt;/P&gt;
&lt;P&gt;2) assuming there is a stock_id, is&amp;nbsp;there only one row per stock_id or may be more ?&lt;/P&gt;
&lt;P&gt;3) are other variables of same name in all datasets ? if positive -&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; which value sholud be in the output in case of same stock_id in more than one dataset ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In case of one row per stock_id in a dataset of each datasets and&lt;/P&gt;
&lt;P&gt;variable names are different in datasets or you don't mind which dataset contribute to output&lt;/P&gt;
&lt;P&gt;then you can merge all of them in one data step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;data all_stocks;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;merge data1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; data2&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &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; ; by stock_id;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;... any other code including filtering ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2016 19:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-SAS-do-this-when-merging-datasets/m-p/306941#M270591</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2016-10-24T19:59:15Z</dc:date>
    </item>
  </channel>
</rss>

