<?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: Linking two tables with multiple rules in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Linking-two-tables-with-multiple-rules/m-p/285720#M58476</link>
    <description>&lt;P&gt;There shouldnt be a cartesian product if you write the boolean clause the way you mean it:&lt;/P&gt;
&lt;P&gt;on A.account = B.account&amp;nbsp;&lt;BR /&gt;and (A.start_date = B.call_date&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; or A.end_date = B.call_date)&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2016 02:55:50 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2016-07-20T02:55:50Z</dc:date>
    <item>
      <title>Linking two tables with multiple rules</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linking-two-tables-with-multiple-rules/m-p/285718#M58474</link>
      <description>&lt;P&gt;Hi -&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a table that has an start date and an end date and need to see if a call was made on the start date or the end date. this is my current query but it does not work.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rsubmit;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table test.field1 as &lt;BR /&gt;select &lt;BR /&gt;A.*, &lt;BR /&gt;B.*&lt;BR /&gt;from test.rock A&lt;BR /&gt;left join test.paper B &lt;BR /&gt;on A.account = B.account&amp;nbsp;&lt;BR /&gt;and A.start_date = B.call_date&lt;BR /&gt;or A.end_date = B.call_date&lt;BR /&gt;;&lt;BR /&gt;endrsubmit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So ideally i want to get a table that shows me all the interactions I got that matched the start date and end date WITH the call_date(different table)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;**the interactions are linked to Call_date which is a different table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the error i got...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The execution of this query involves performing one or more Cartesian product joins that&lt;BR /&gt; can not be optimized.&lt;BR /&gt;ERROR: A lock is not available for &lt;SPAN&gt;test.field&lt;/SPAN&gt;&lt;BR /&gt;ERROR: Lock held by process 5229800&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 02:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linking-two-tables-with-multiple-rules/m-p/285718#M58474</guid>
      <dc:creator>itshere</dc:creator>
      <dc:date>2016-07-20T02:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Linking two tables with multiple rules</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Linking-two-tables-with-multiple-rules/m-p/285720#M58476</link>
      <description>&lt;P&gt;There shouldnt be a cartesian product if you write the boolean clause the way you mean it:&lt;/P&gt;
&lt;P&gt;on A.account = B.account&amp;nbsp;&lt;BR /&gt;and (A.start_date = B.call_date&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; or A.end_date = B.call_date)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2016 02:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Linking-two-tables-with-multiple-rules/m-p/285720#M58476</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2016-07-20T02:55:50Z</dc:date>
    </item>
  </channel>
</rss>

