<?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 using SAS to compare to Excel files in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196003#M49017</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to use SAS to compare entries in two excel files and look for mismatches?&amp;nbsp; The mismatches would appear as a new row of data.&amp;nbsp; These would be for entries added later after my original excel extract at the end of each month.&amp;nbsp; It takes about an additional month for the books to officially close for each month, and I want to make sure there were no additions after my original extract.&amp;nbsp; Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 29 May 2015 13:32:32 GMT</pubDate>
    <dc:creator>jmckenzie</dc:creator>
    <dc:date>2015-05-29T13:32:32Z</dc:date>
    <item>
      <title>using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196003#M49017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to use SAS to compare entries in two excel files and look for mismatches?&amp;nbsp; The mismatches would appear as a new row of data.&amp;nbsp; These would be for entries added later after my original excel extract at the end of each month.&amp;nbsp; It takes about an additional month for the books to officially close for each month, and I want to make sure there were no additions after my original extract.&amp;nbsp; Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 13:32:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196003#M49017</guid>
      <dc:creator>jmckenzie</dc:creator>
      <dc:date>2015-05-29T13:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196004#M49018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just read both into SAS and use proc compare.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 13:40:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196004#M49018</guid>
      <dc:creator>AskoLötjönen</dc:creator>
      <dc:date>2015-05-29T13:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196005#M49019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Firstly, why use Excel for the data at all?&amp;nbsp; Data should be stored in a database or datawarehouse, that is what those applications are built for.&amp;nbsp; Excel is not built for this (or pretty much anything else).&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If however you absolutely have to have Excel files, then why not use VBA which is built into Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are still instisting on doing thing the hard way, then you would need to import each datafile - i.e. write a datastep import for each.&amp;nbsp; Then you could run a proc compare, or data merge, then output the result to Excel again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Seriously though, if you do things correctly and use a database, then the audit trail from the database will tell you what has changed, all the above is just additional work for no gain.&amp;nbsp; There are also Excel file compare programs available for free online.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 13:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196005#M49019</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-29T13:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196006#M49020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&amp;nbsp; I imported my two files and used proc compare.&amp;nbsp; How do I export the observations that are different?&amp;nbsp; There is a warning message in my log that correctly states there are 156 observations&amp;nbsp; in one data set but not the other.&amp;nbsp; I cannot figure out how to export these 156 observations.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 16:45:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196006#M49020</guid>
      <dc:creator>jmckenzie</dc:creator>
      <dc:date>2015-05-29T16:45:04Z</dc:date>
    </item>
    <item>
      <title>Re: using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196007#M49021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The proc compare has many options: &lt;A class="active_link" href="https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473377.htm" title="https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473377.htm"&gt;https://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a002473377.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One of those is to create an output dataset with differences.&amp;nbsp; You can then export that dataset.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From my side though I would find it easier to identify id variables, then merge the two datasets by those variables.&amp;nbsp; Then output the results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 17:20:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196007#M49021</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-29T17:20:10Z</dc:date>
    </item>
    <item>
      <title>Re: using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196008#M49022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to be able to export only those rows of data that are in the new file but not the old.&amp;nbsp; Maybe this is not possible.&amp;nbsp; I'm new to this and am not sure what I'm doing so thanks for your patience.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc compare base=old compare=new outdif out=result;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not for sure exactly what my table named result is showing me, but it's definitely not the new rows of data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 20:24:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196008#M49022</guid>
      <dc:creator>jmckenzie</dc:creator>
      <dc:date>2015-05-29T20:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: using SAS to compare to Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196009#M49023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proc compare basically does a row by row comparison. If the two sets are in a different order then then you get lots of differences.&lt;/P&gt;&lt;P&gt;To effectively use Proc compare for what I think you are doing you may need to sort both datasets by the same variables. If there isn't an obvious set of variables that will uniquely identify a record, this may mean sorting by practically every variable in the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or possibly this might work:&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; create table want as&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from table2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select * from table1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;Where table2 is the set name of the new file. If the variables differ, not of the same type with the same name or different numbers of variables this may not work though.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 May 2015 21:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/using-SAS-to-compare-to-Excel-files/m-p/196009#M49023</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-05-29T21:02:18Z</dc:date>
    </item>
  </channel>
</rss>

