<?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: How to find the updates/changes between 2 datasets with different extraction date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792704#M253999</link>
    <description>&lt;P&gt;PROC COMPARE is a lot easier than the approach you are suggesting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However is there a unique key for the rows in the table? If not you are going to have a hard time lining up the rows to compare.&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jan 2022 23:32:31 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2022-01-26T23:32:31Z</dc:date>
    <item>
      <title>How to find the updates/changes between 2 datasets with different extraction date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792693#M253994</link>
      <description>&lt;P&gt;Hi all:&lt;/P&gt;
&lt;P&gt;I am trying to create a report by comparing 2 sas datasets with SAME variable name but different values due to different extraction dates&lt;/P&gt;
&lt;P&gt;----Goal: to highlight differences : New, Deleted, Updated and find out which record is different.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---The challenge is :&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.There are lots of variables about 20-30 in each ds to be compared ;&lt;/P&gt;
&lt;P&gt;2. Variables are mixed with numerical var. and character including dates.&lt;/P&gt;
&lt;P&gt;3. Need to highlight different colors in excel file per the difference&lt;/P&gt;
&lt;P&gt;4. used many arrays and %let variables to identify old, new and flags&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---Steps I used but very prone to mistake:&lt;/P&gt;
&lt;P&gt;*1.Rename old datasets variables for comparing with new datasets by suffix old_ for comparation purpose; EG. TEST TO OLD_TEST&lt;BR /&gt;*2.Convert all selected Numeric variables to Character variables&amp;nbsp; by adding suffix c_ . So I may use one set of array for all same type of variables.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;EG. DATE TO C_DATE&lt;BR /&gt;*3. Drop original numerical variables and keep all c_: .&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Otherwise the values will not be able to overwrite.&amp;nbsp; DROP DATE;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*4. Rename again variables with suffix c_: Back to&amp;nbsp; old &amp;amp; new data original names for merge and compare in data step;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;EG: RENAME C_DATE =DATE&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;---Question:&lt;/P&gt;
&lt;P&gt;Does any one have any code sample which might use proc content level to work on this ?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks a lot,&lt;/P&gt;
&lt;P&gt;Purpleclothlady&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 22:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792693#M253994</guid>
      <dc:creator>purpleclothlady</dc:creator>
      <dc:date>2022-01-26T22:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the updates/changes between 2 datasets with different extraction date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792696#M253995</link>
      <description>&lt;P&gt;You are going to have a hard time dealing with two data sets with the same name. Unless dealing with generation sets you only have one SAS data set of a given name in a library.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you mean to different data sets then sort them using identification variables other than those you know to change so the order should be identical.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use Proc compare. It will compare every value of all the variables and report on differences. There are multiple choices for output data sets and contents. I am not quite sure what you want.&lt;/P&gt;
&lt;P&gt;If one data set may have a different number of records us a BY statement with the By variables used for sorting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest the sort and run Proc Compare with the defaults to see the output. The basic syntax is extremely simple:&lt;/P&gt;
&lt;PRE&gt;Proc Compare base=thisdatasetname compare=thatdatasetname;
run;&lt;/PRE&gt;
&lt;P&gt;If variables are of different types with the same name you won't get a value comparison. There is a header section that describes differences in the data sets, like/unlike named variables, number of observations, variables with same name but different type, different properties such as Label or Format for the same name variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Different colors in Excel" is a report function and will depend on what your rules are.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 22:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792696#M253995</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-01-26T22:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the updates/changes between 2 datasets with different extraction date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792701#M253998</link>
      <description>&lt;P&gt;When trying to build a new process I first search lexjansen.com to see what's already developed:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.mwsug.org/proceedings/2011/appdev/MWSUG-2011-AD09.pdf" target="_blank"&gt;https://www.mwsug.org/proceedings/2011/appdev/MWSUG-2011-AD09.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This one seems somewhat close to what you're trying to do?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC COMPARE is probably the easiest starting point.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 22:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792701#M253998</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-01-26T22:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the updates/changes between 2 datasets with different extraction date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792704#M253999</link>
      <description>&lt;P&gt;PROC COMPARE is a lot easier than the approach you are suggesting.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However is there a unique key for the rows in the table? If not you are going to have a hard time lining up the rows to compare.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2022 23:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792704#M253999</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2022-01-26T23:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to find the updates/changes between 2 datasets with different extraction date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792843#M254051</link>
      <description>&lt;P&gt;hi Dear all:&lt;/P&gt;
&lt;P&gt;thank you so much,&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; maybe I didn't explain the goal clearly.&lt;/P&gt;
&lt;P&gt;I had first checked SASpaper . this is the exactly what I need to accomplish, there are many places need to be fixed though. I will try to use this as blueprint.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A tabindex="0" href="https://www.pharmasug.org/proceedings/2017/AD/PharmaSUG-2017-AD04.pdf" target="_blank" rel="noopener"&gt;https://www.pharmasug.org/proceedings/2017/AD/PharmaSUG-2017-AD04.pdf&lt;/A&gt;&lt;/P&gt;
&lt;DIV&gt;Have a nice day.&lt;/DIV&gt;
&lt;DIV&gt;P&lt;/DIV&gt;</description>
      <pubDate>Thu, 27 Jan 2022 13:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-find-the-updates-changes-between-2-datasets-with/m-p/792843#M254051</guid>
      <dc:creator>purpleclothlady</dc:creator>
      <dc:date>2022-01-27T13:23:55Z</dc:date>
    </item>
  </channel>
</rss>

