<?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: Merge and proc sql left join merge diffrence in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-and-proc-sql-left-join-merge-diffrence/m-p/387306#M92859</link>
    <description>&lt;P&gt;When you have three matches in one dataset and two in the other (for a given condition), the data step merge will result in three observations (the values fronm the second observation in the second dataset will show up in the second and third match), while SQL will result in six observations (all combinations). The SQL result is called a cartesian join.&lt;/P&gt;
&lt;P&gt;With a data step, you will also get a NOTE in the log notfiying you that more than one dataset contains multiple matches, as that is often not intended.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2017 12:10:44 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-08-11T12:10:44Z</dc:date>
    <item>
      <title>Merge and proc sql left join merge diffrence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-and-proc-sql-left-join-merge-diffrence/m-p/387303#M92858</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What the diffrence between this two merging ways, both of them give me diffrent num of rows(2561984 and&amp;nbsp;2561938 ),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data wyn22;&lt;BR /&gt;merge skzr1(in=zb1) krel;&lt;BR /&gt;by id_klienta;&lt;BR /&gt;id_cst=coalesce(id_klienta_rel, id_klienta);&lt;BR /&gt;if zb1=1 then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table wyn22_1 as&lt;BR /&gt;select skzr1.*, krel.*, coalesce(id_klienta_rel, skzr1.id_klienta) as id_cst from&lt;BR /&gt;skzr1 left join krel&lt;BR /&gt;on skzr1.id_klienta=krel.id_klienta;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 11:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-and-proc-sql-left-join-merge-diffrence/m-p/387303#M92858</guid>
      <dc:creator>Matt3</dc:creator>
      <dc:date>2017-08-11T11:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Merge and proc sql left join merge diffrence</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-and-proc-sql-left-join-merge-diffrence/m-p/387306#M92859</link>
      <description>&lt;P&gt;When you have three matches in one dataset and two in the other (for a given condition), the data step merge will result in three observations (the values fronm the second observation in the second dataset will show up in the second and third match), while SQL will result in six observations (all combinations). The SQL result is called a cartesian join.&lt;/P&gt;
&lt;P&gt;With a data step, you will also get a NOTE in the log notfiying you that more than one dataset contains multiple matches, as that is often not intended.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 12:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-and-proc-sql-left-join-merge-diffrence/m-p/387306#M92859</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-08-11T12:10:44Z</dc:date>
    </item>
  </channel>
</rss>

