<?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 - join 3 tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252217#M47816</link>
    <description>&lt;P&gt;They belong in a WHERE most likely, not on the join condition.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2016 21:00:06 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2016-02-24T21:00:06Z</dc:date>
    <item>
      <title>Proc Sql - join 3 tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252178#M47791</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to join 3 tables in on proc sql statement and i can't seem to figure out how to do so...&lt;/P&gt;&lt;P&gt;the code below is what i have:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table test as&amp;nbsp;&lt;/P&gt;&lt;P&gt;select a.store, b.name, c.type&amp;nbsp;&lt;/P&gt;&lt;P&gt;from data1 a&amp;nbsp;&lt;/P&gt;&lt;P&gt;inner join data2 b&lt;/P&gt;&lt;P&gt;on a.id = b.id&lt;/P&gt;&lt;P&gt;left join data3 c&lt;/P&gt;&lt;P&gt;on b.id2=c.id2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&amp;lt;exclusion statements&amp;gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is there something wrong with my code?&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 19:42:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252178#M47791</guid>
      <dc:creator>lai302120</dc:creator>
      <dc:date>2016-02-24T19:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql - join 3 tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252182#M47792</link>
      <description>&lt;P&gt;Nothing wrong with your code, which means there's something wrong in the logic.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Things to check - join types inner vs left vs right&lt;/P&gt;
&lt;P&gt;And your exclusion criteria. You can run it without and then with to see if that helps.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 19:47:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252182#M47792</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-24T19:47:39Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql - join 3 tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252213#M47812</link>
      <description>&lt;P&gt;Thanks, Reeza.&lt;/P&gt;&lt;P&gt;I ran the code with the exclusion statements and the dataset created seemed to have ignored all the exclusion criteria i wrote.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have any ideas as to why this might happen?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;exclusion statements:&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;and b.sls_typ ^= '05'&lt;BR /&gt;and ( (b.xtnd_prc &amp;gt; 0.01) or (b.xtnd_prc &amp;lt; -0.01) )&lt;BR /&gt;and b.trans_dt &amp;gt;= '03JAN2016'd/*&amp;amp;beg_dt1*/&lt;BR /&gt;and b.trans_dt &amp;lt;= '04JAN2016'd/*&amp;amp;end_dt1*/&lt;BR /&gt;and a.ADDR_ID ^= .&lt;BR /&gt;order by a.ADDR_ID&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 20:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252213#M47812</guid>
      <dc:creator>lai302120</dc:creator>
      <dc:date>2016-02-24T20:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql - join 3 tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252216#M47815</link>
      <description>&lt;P&gt;ahh nevermind. the code is working out...my datasets timed out so they weren't being read in.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for the help!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 20:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252216#M47815</guid>
      <dc:creator>lai302120</dc:creator>
      <dc:date>2016-02-24T20:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Sql - join 3 tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252217#M47816</link>
      <description>&lt;P&gt;They belong in a WHERE most likely, not on the join condition.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 21:00:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Sql-join-3-tables/m-p/252217#M47816</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-02-24T21:00:06Z</dc:date>
    </item>
  </channel>
</rss>

