<?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: Proc sql left join in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425582#M104837</link>
    <description>&lt;P&gt;Because your key variable PRODUCT_ID has duplicated value in table a6.smb.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and both table have the same variable PRODUCT_ID, therefore you get the WARNING.&lt;/P&gt;</description>
    <pubDate>Sun, 07 Jan 2018 11:04:58 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2018-01-07T11:04:58Z</dc:date>
    <item>
      <title>Proc sql left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425580#M104836</link>
      <description>&lt;P&gt;I have to use proc sql to left join two tables&lt;/P&gt;&lt;PRE&gt;proc sql;
create table a6.s as
select f.*, c.*
from a6.smb as f 
left join
a6.churn as c 
on f.PRODUCT_ID=c.PRODUCT_ID;
quit;&lt;/PRE&gt;&lt;P&gt;Table a6.smb has 99999&amp;nbsp;rows (and 300 columns) and a6.churn has 6465 rows (and 2 columns) . I want to add the column from churn table to smb table where product_id is the common column in the two tables.&lt;/P&gt;&lt;P&gt;when i use this code i get 12930&amp;nbsp;rows (6465 *2=12930) and 301 columns .&lt;/P&gt;&lt;P&gt;But isnt left join supposed to give me 99999 rows and that's what I want.&lt;/P&gt;&lt;P&gt;What is wrong with my code?&lt;/P&gt;&lt;P&gt;also i get the&amp;nbsp;warning that Product_id already exists in a6.s&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 11:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425580#M104836</guid>
      <dc:creator>riya275</dc:creator>
      <dc:date>2018-01-07T11:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425582#M104837</link>
      <description>&lt;P&gt;Because your key variable PRODUCT_ID has duplicated value in table a6.smb.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and both table have the same variable PRODUCT_ID, therefore you get the WARNING.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 11:04:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425582#M104837</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2018-01-07T11:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425583#M104838</link>
      <description>Each product_id is repeated thrice in a6.smb. but its 9 times in the final a6.s table. Why is it there 9 times?</description>
      <pubDate>Sun, 07 Jan 2018 11:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425583#M104838</guid>
      <dc:creator>riya275</dc:creator>
      <dc:date>2018-01-07T11:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425585#M104840</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/163953"&gt;@riya275&lt;/a&gt; wrote:&lt;BR /&gt;Each product_id is repeated thrice in a6.smb. but its 9 times in the final a6.s table. Why is it there 9 times?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Because it's also repeated thrice in churn.&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2018 11:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425585#M104840</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-01-07T11:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql left join</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425636#M104850</link>
      <description>&lt;P&gt;So it looks like this would be better:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a6.s;
merge a6.smb a6.churn;
by product_id;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Jan 2018 23:21:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql-left-join/m-p/425636#M104850</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2018-01-07T23:21:10Z</dc:date>
    </item>
  </channel>
</rss>

