<?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: CREATE TABLE BASED ON MULTIPLE CONDITIONS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/CREATE-TABLE-BASED-ON-MULTIPLE-CONDITIONS/m-p/651074#M195303</link>
    <description>&lt;P&gt;SAS SQL does not have what is known as a in-tuple.&amp;nbsp; You will need to create a surrogate for the dual requirement of person AND their corresponding date being in some likewise list. The easiest surrogate is a string concatenation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;create table SON_TABLE as
select *
from FATHER_TABLE
where
  catx('~', person_ID, date) not in 
    (select catx('~', person_ID, date) from PARENT_TABLE)
;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 27 May 2020 13:07:37 GMT</pubDate>
    <dc:creator>RichardDeVen</dc:creator>
    <dc:date>2020-05-27T13:07:37Z</dc:date>
    <item>
      <title>CREATE TABLE BASED ON MULTIPLE CONDITIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CREATE-TABLE-BASED-ON-MULTIPLE-CONDITIONS/m-p/651070#M195300</link>
      <description>&lt;P&gt;Hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a table as a copy of a "father table" based on two WHERE conditions that make reference to a "parent table". In particular, I've wrote:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc sql;
create table SON_TABLE as
select *
from FATHER_TABLE
where
person_ID not in (select person_ID from PARENT_TABLE)
and
DATE not in (select DATE from PARENT_TABLE);&amp;nbsp;

quit;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know for sure that the table should be populated but it shows zero rows instead.&amp;nbsp;I guess something is wrong in how the conditions are stated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;May anyone explain me how can i fix this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 12:59:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CREATE-TABLE-BASED-ON-MULTIPLE-CONDITIONS/m-p/651070#M195300</guid>
      <dc:creator>salvavit</dc:creator>
      <dc:date>2020-05-27T12:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: CREATE TABLE BASED ON MULTIPLE CONDITIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/CREATE-TABLE-BASED-ON-MULTIPLE-CONDITIONS/m-p/651074#M195303</link>
      <description>&lt;P&gt;SAS SQL does not have what is known as a in-tuple.&amp;nbsp; You will need to create a surrogate for the dual requirement of person AND their corresponding date being in some likewise list. The easiest surrogate is a string concatenation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;create table SON_TABLE as
select *
from FATHER_TABLE
where
  catx('~', person_ID, date) not in 
    (select catx('~', person_ID, date) from PARENT_TABLE)
;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 May 2020 13:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/CREATE-TABLE-BASED-ON-MULTIPLE-CONDITIONS/m-p/651074#M195303</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-05-27T13:07:37Z</dc:date>
    </item>
  </channel>
</rss>

