<?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: Left join using Proc sql creates extra rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694730#M211887</link>
    <description>Or you could have missing value in gvkey or fyear .</description>
    <pubDate>Wed, 28 Oct 2020 03:17:24 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-10-28T03:17:24Z</dc:date>
    <item>
      <title>Left join using Proc sql creates extra rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694725#M211884</link>
      <description>&lt;P&gt;I am using the following code to left join&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt;select *&lt;BR /&gt;from final3 left join gov_proxy&lt;BR /&gt;on final3.gvkey=gov_proxy.gvkey and&lt;BR /&gt;final3.fyear=gov_proxy.fyear;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;I have 63,654 observations in my final3 dataset and&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 186679&amp;nbsp;observations in my gov-proxy dataset&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to have 63,654 dataset but I am getting 63888 dataset after deleting the duprecs after merging.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no duprecs in any one of the dataset before merging.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone help me with this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 02:09:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694725#M211884</guid>
      <dc:creator>abdulla</dc:creator>
      <dc:date>2020-10-28T02:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Left join using Proc sql creates extra rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694728#M211885</link>
      <description>&lt;P&gt;You may not have any duplicate records, but you have at least 234 duplicate keys (gvkey-fyear) in gov_proxy.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 02:38:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694728#M211885</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-10-28T02:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Left join using Proc sql creates extra rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694729#M211886</link>
      <description>&lt;P&gt;This isn't a duplicate record problem, it is a duplicate key problem. Your join results indicate that you either have duplicate key values in either final3 or gov_proxy or both. You can test this easily:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data = final3 out = dupkey nodupkey;
  by gvkey fyear;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If dupkey has less records than final3 then you know it contains duplicate key values. Then the question is should the data have&amp;nbsp;duplicate key values and if not how do you wish to fix this?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 02:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694729#M211886</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-10-28T02:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Left join using Proc sql creates extra rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694730#M211887</link>
      <description>Or you could have missing value in gvkey or fyear .</description>
      <pubDate>Wed, 28 Oct 2020 03:17:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Left-join-using-Proc-sql-creates-extra-rows/m-p/694730#M211887</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-10-28T03:17:24Z</dc:date>
    </item>
  </channel>
</rss>

