<?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 in a Create Table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611898#M76811</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/287480"&gt;@anweinbe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this (untested code)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table temp.final_Indp_Prct as
	select a.*, b.*
	from temp.Summ_Owners_2 as a left join temp.Summ_Ind as b
	on a.cusip=b.cusip and a.base_year=b.base_year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;-&amp;gt; replace "where" by "on" when you use a left join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
    <pubDate>Sun, 15 Dec 2019 17:40:26 GMT</pubDate>
    <dc:creator>ed_sas_member</dc:creator>
    <dc:date>2019-12-15T17:40:26Z</dc:date>
    <item>
      <title>Left Join in a Create Table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611890#M76810</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to build a new table using a proc sql create command (below). This code does work, however I am trying to add to it and have not gotten it to work. I would like to keep all records in my table "a" even if there is no match in table "b". I tried multiple things but clearly missing something easy...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;my current code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table temp.final_Indp_Prct&lt;BR /&gt;as select a.*, b.*&lt;BR /&gt;from temp.Summ_Owners_2 as a, temp.Summ_Ind as b&lt;BR /&gt;where a.cusip=b.cusip and a.base_year=b.base_year;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 17:20:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611890#M76810</guid>
      <dc:creator>anweinbe</dc:creator>
      <dc:date>2019-12-15T17:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join in a Create Table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611898#M76811</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/287480"&gt;@anweinbe&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this (untested code)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table temp.final_Indp_Prct as
	select a.*, b.*
	from temp.Summ_Owners_2 as a left join temp.Summ_Ind as b
	on a.cusip=b.cusip and a.base_year=b.base_year;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;-&amp;gt; replace "where" by "on" when you use a left join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 17:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611898#M76811</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-15T17:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Left Join in a Create Table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611909#M76814</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 15 Dec 2019 19:20:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Left-Join-in-a-Create-Table/m-p/611909#M76814</guid>
      <dc:creator>anweinbe</dc:creator>
      <dc:date>2019-12-15T19:20:03Z</dc:date>
    </item>
  </channel>
</rss>

