<?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 proc sql :  where condition with multiple varibles in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-where-condition-with-multiple-varibles/m-p/483292#M71707</link>
    <description>&lt;P&gt;I want to keep&amp;nbsp;all observation(after merging&amp;nbsp;&amp;nbsp;tb1 and tbl2 ), but drop from it all observations that exist in tbl3.&lt;/P&gt;&lt;P&gt;the code is used is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table tbl4 vas
select t1.*
from tbl1 t1
right join tbl2 t2 on t1.x1=t2.x1 and t1.x2=t2.x2 and t1.x3=t2.x3
where t1.x1 not in(select x1 from tbl3) and t1.x2 in(select x2 from tbl3) and t1.x3 in(select x3 from tbl3)
order by x1, x2, x3
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is wrong?&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 06:51:54 GMT</pubDate>
    <dc:creator>AlexeyS</dc:creator>
    <dc:date>2018-08-02T06:51:54Z</dc:date>
    <item>
      <title>proc sql :  where condition with multiple varibles</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-where-condition-with-multiple-varibles/m-p/483292#M71707</link>
      <description>&lt;P&gt;I want to keep&amp;nbsp;all observation(after merging&amp;nbsp;&amp;nbsp;tb1 and tbl2 ), but drop from it all observations that exist in tbl3.&lt;/P&gt;&lt;P&gt;the code is used is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table tbl4 vas
select t1.*
from tbl1 t1
right join tbl2 t2 on t1.x1=t2.x1 and t1.x2=t2.x2 and t1.x3=t2.x3
where t1.x1 not in(select x1 from tbl3) and t1.x2 in(select x2 from tbl3) and t1.x3 in(select x3 from tbl3)
order by x1, x2, x3
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is wrong?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 06:51:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-where-condition-with-multiple-varibles/m-p/483292#M71707</guid>
      <dc:creator>AlexeyS</dc:creator>
      <dc:date>2018-08-02T06:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql :  where condition with multiple varibles</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-where-condition-with-multiple-varibles/m-p/483298#M71708</link>
      <description>&lt;P&gt;Just an idea:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table tbl4 as
  select t1.*
  from tbl1 t1
  right join tbl2 t2 on t1.x1=t2.x1 and t1.x2=t2.x2 and t1.x3=t2.x3
  left join tbl3 t3 on t1.x1=t3.x1 and t1.x2=t3.x2 and t1.x3=t3.x3
where t3.x1 is missing
order by t1.x1, t1.x2, t1.x3
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 07:18:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-where-condition-with-multiple-varibles/m-p/483298#M71708</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-02T07:18:46Z</dc:date>
    </item>
  </channel>
</rss>

