<?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 data sets in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Compare-two-data-sets/m-p/179255#M45765</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have two data sets that come from the same code, but run at two different points in time. One of the variables, Jur2006, has more 2000 observations marked as 'true' in the prior run than the current run. I would expect a few hundred different, but 2000 is too many.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To see what the difference is relative to the observations, I would like to compare the two data sets and identify the observations marked as 'true' in the prior run, but no longer marked as 'true' in the current run and output those observations in a 3rd data set. Is there a way to do this with PROC COMPARE or using a simple merge (which I am trying)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Feb 2014 14:45:40 GMT</pubDate>
    <dc:creator>Paul_NYS</dc:creator>
    <dc:date>2014-02-19T14:45:40Z</dc:date>
    <item>
      <title>Compare two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compare-two-data-sets/m-p/179255#M45765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have two data sets that come from the same code, but run at two different points in time. One of the variables, Jur2006, has more 2000 observations marked as 'true' in the prior run than the current run. I would expect a few hundred different, but 2000 is too many.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To see what the difference is relative to the observations, I would like to compare the two data sets and identify the observations marked as 'true' in the prior run, but no longer marked as 'true' in the current run and output those observations in a 3rd data set. Is there a way to do this with PROC COMPARE or using a simple merge (which I am trying)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 14:45:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compare-two-data-sets/m-p/179255#M45765</guid>
      <dc:creator>Paul_NYS</dc:creator>
      <dc:date>2014-02-19T14:45:40Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two data sets</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Compare-two-data-sets/m-p/179256#M45766</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like a job for Proc SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Proc Sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create table mismatch as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select a.*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from ( select * from FirstDataSet where Jur2006='True') as a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; natural join&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (select * from SecondDataSet where Jur2006='False') as a&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where a.Jur2006 ne b.Jur2006;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;You'll need to change the names of the datasets and how the variable is indicated to be true or false. The output dataset barring ill fortune should have the records from the first run where the value changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: if enough values are repeated such that what might be considered a combination of identification variables have the same pattern for multiple records you're going to have some fun.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Feb 2014 20:25:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Compare-two-data-sets/m-p/179256#M45766</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-02-19T20:25:40Z</dc:date>
    </item>
  </channel>
</rss>

