<?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: Merging Multiple Datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295446#M61734</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not much I could really add to what is in the documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001304305.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001304305.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At a quick look, the one I would start with is A full join B on A.ID=B.ID.&lt;/P&gt;
&lt;P&gt;SQL joins are:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4778i396D1FDC86285596/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 31 Aug 2016 10:22:46 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-08-31T10:22:46Z</dc:date>
    <item>
      <title>Merging Multiple Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295444#M61733</link>
      <description>&lt;P&gt;I have a below sample SAS query which i need to convert ot SQl.&lt;/P&gt;&lt;P&gt;Can any one please help me in understanding the query, which is:&lt;/P&gt;&lt;P&gt;Merge Dataset1 (In=data1 keep col1, col2....)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataSet2&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;DataSet3&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Dataset4&lt;/P&gt;&lt;P&gt;By id;&lt;/P&gt;&lt;P&gt;if data1=1&amp;nbsp;&lt;/P&gt;&lt;P&gt;%ran&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 10:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295444#M61733</guid>
      <dc:creator>monalisa</dc:creator>
      <dc:date>2016-08-31T10:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Multiple Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295446#M61734</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not much I could really add to what is in the documentation:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001304305.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001304305.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At a quick look, the one I would start with is A full join B on A.ID=B.ID.&lt;/P&gt;
&lt;P&gt;SQL joins are:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/4778i396D1FDC86285596/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="Capture.PNG" title="Capture.PNG" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 10:22:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295446#M61734</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-08-31T10:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Multiple Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295458#M61736</link>
      <description>&lt;P&gt;What's in %ran?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Dataset1 is left joined with 2,3,4 on key field ID.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 10:46:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295458#M61736</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-31T10:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Multiple Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295479#M61749</link>
      <description>&lt;P&gt;Am new to SAS. What i understood till now is SAS merges 2 dataset at a time (not sure though). If this is the case, then here Dataset1 left join dataset2, then output left join dataset3 and so on.Is this correct?&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 12:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295479#M61749</guid>
      <dc:creator>monalisa</dc:creator>
      <dc:date>2016-08-31T12:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Merging Multiple Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295490#M61756</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/101869"&gt;@monalisa&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Am new to SAS. What i understood till now is SAS merges 2 dataset at a time (not sure though). If this is the case, then here Dataset1 left join dataset2, then output left join dataset3 and so on.Is this correct?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;No, I don't think that's accurate.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have multiple IDs in each dataset you won't get the results you expect compared to SQL, ie many to many match.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The IF IN statement is what's used to filter the join and create a left join.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your best bet is to create a sample dataset and compare the results between the two Procs until you get your desired result.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Aug 2016 13:05:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-Multiple-Datasets/m-p/295490#M61756</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-31T13:05:15Z</dc:date>
    </item>
  </channel>
</rss>

