<?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 Compare two dependant tables without updating one of them in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653597#M22527</link>
    <description>&lt;P&gt;Hi all. I am a bit confused about how to handle this situation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an input table (table A) storing a list of Names, Surnames, IDs, Telephone numbers, Dates of birth and other personal data. This table is ran and updated every day, with new records appended.&lt;/P&gt;&lt;P&gt;From this table, I created another table (table B) containing only IDs and Telephone numbers from table A. This table is likewise updated every day.&lt;/P&gt;&lt;P&gt;What I need to do is to compare the newest version of table A with yesterday's version of table B, i.e. I need to extract the records that have been inserted in table A in the last run. How can I do this?&lt;/P&gt;</description>
    <pubDate>Fri, 05 Jun 2020 14:19:26 GMT</pubDate>
    <dc:creator>salvavit</dc:creator>
    <dc:date>2020-06-05T14:19:26Z</dc:date>
    <item>
      <title>Compare two dependant tables without updating one of them</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653597#M22527</link>
      <description>&lt;P&gt;Hi all. I am a bit confused about how to handle this situation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an input table (table A) storing a list of Names, Surnames, IDs, Telephone numbers, Dates of birth and other personal data. This table is ran and updated every day, with new records appended.&lt;/P&gt;&lt;P&gt;From this table, I created another table (table B) containing only IDs and Telephone numbers from table A. This table is likewise updated every day.&lt;/P&gt;&lt;P&gt;What I need to do is to compare the newest version of table A with yesterday's version of table B, i.e. I need to extract the records that have been inserted in table A in the last run. How can I do this?&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 14:19:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653597#M22527</guid>
      <dc:creator>salvavit</dc:creator>
      <dc:date>2020-06-05T14:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two dependant tables without updating one of them</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653605#M22528</link>
      <description>&lt;P&gt;Keep your tables sorted by ID. Then you can do;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data compare;
merge
  a (in=a keep=id)
  b (in=b keep=id)
;
by id;
if a and not b;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;before you update B.&lt;/P&gt;
&lt;P&gt;Or, in SQL:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table compare as
  select a.id
  from a
  where a.id not in (select id from b)
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jun 2020 14:42:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653605#M22528</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-05T14:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two dependant tables without updating one of them</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653668#M22529</link>
      <description>Thanks for your reply Kurt.&lt;BR /&gt;Unfortunately, I think I can't implement your solution. Both table A&lt;BR /&gt;and table B are created and defined in the same SAS program in which I&lt;BR /&gt;want to perform that comparison. That is, if I were to compare the two&lt;BR /&gt;table before B is updated, this would mean that I am comparing Table A&lt;BR /&gt;to a table that does not exist yet.&lt;BR /&gt;I am quite new in SAS programming so I might be wrong, but I didn't&lt;BR /&gt;find any online support documentation on this matter.&lt;BR /&gt;</description>
      <pubDate>Fri, 05 Jun 2020 15:29:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653668#M22529</guid>
      <dc:creator>salvavit</dc:creator>
      <dc:date>2020-06-05T15:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two dependant tables without updating one of them</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653679#M22530</link>
      <description>&lt;P&gt;So where is the old table, anyway? It must exist somewhere in a permanent library.&lt;/P&gt;
&lt;P&gt;Create the new tables in WORK, and then compare the WORK table with its counterpart in the permanent library. After that is done, copy the WORK tables to the permanent location.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jun 2020 15:40:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Compare-two-dependant-tables-without-updating-one-of-them/m-p/653679#M22530</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-05T15:40:55Z</dc:date>
    </item>
  </channel>
</rss>

