<?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 how to select only same values from 2 datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260449#M50541</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem that looks easy but i don't find a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 datasets with variables like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data1: A B var1 var2 var3&lt;/P&gt;&lt;P&gt;Data2: A B var4 var5 var6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variables A and B have values that exist in both datasets but also values that exist in only one or another table. B is&amp;nbsp; sub-classe of A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to keep only values that exist in both tables and delete the others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with merge and sql but couldn't find a solution. If anyone can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2016 15:34:53 GMT</pubDate>
    <dc:creator>imath</dc:creator>
    <dc:date>2016-03-31T15:34:53Z</dc:date>
    <item>
      <title>how to select only same values from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260449#M50541</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a problem that looks easy but i don't find a solution:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 datasets with variables like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data1: A B var1 var2 var3&lt;/P&gt;&lt;P&gt;Data2: A B var4 var5 var6&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Variables A and B have values that exist in both datasets but also values that exist in only one or another table. B is&amp;nbsp; sub-classe of A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to keep only values that exist in both tables and delete the others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with merge and sql but couldn't find a solution. If anyone can help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 15:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260449#M50541</guid>
      <dc:creator>imath</dc:creator>
      <dc:date>2016-03-31T15:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to select only same values from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260451#M50542</link>
      <description>&lt;P&gt;Have you tried something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
merge 
    have1 (in=x)
    have2 (in=y);
by a b;
if x and y;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 15:41:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260451#M50542</guid>
      <dc:creator>DanZ</dc:creator>
      <dc:date>2016-03-31T15:41:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to select only same values from 2 datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260459#M50544</link>
      <description>Yes! Thank you very much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 31 Mar 2016 16:02:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-select-only-same-values-from-2-datasets/m-p/260459#M50544</guid>
      <dc:creator>imath</dc:creator>
      <dc:date>2016-03-31T16:02:55Z</dc:date>
    </item>
  </channel>
</rss>

