<?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 Compare fields in Two Different Datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Compare-fields-in-Two-Different-Datasets/m-p/354609#M82971</link>
    <description>&lt;P&gt;Post sample data and expected output - not real data because you obviously can't release that, but some data that's similar to what you have, especially if you want code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Things that are unclear in your current question:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Do you want the final dataset to have all people, only people in first dataset, only people in second, only people in both?&lt;/LI&gt;
&lt;LI&gt;Are the formats/type the same between the two for merges - they have to be.&lt;/LI&gt;
&lt;LI&gt;When I've&amp;nbsp;worked with medical data and we also used a window, not a specific date=date, because a lot of times a wait in an ER can stretch over midnight which means dates for things may be off by at minimum one date. If this isn't a concern feel free to ignore this comment &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Otherwise this is most likely more easy to accomplish in SQL though a data step merge is also possible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2017 20:46:37 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-04-28T20:46:37Z</dc:date>
    <item>
      <title>How to Compare fields in Two Different Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Compare-fields-in-Two-Different-Datasets/m-p/354605#M82970</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have two different datasets that provide info on claim amount paid by two different sources. &amp;nbsp;Each &amp;nbsp;set includes the&amp;nbsp;claimant name, the date of incident, and the amount paid. &amp;nbsp;So let's say&amp;nbsp;Name1, Date1, and Paid 1 are fields in Set #1, and Name2, Date2, and Paid2 are fields in Set #2. &amp;nbsp;Each of the two sets includes other fields that are not totally identical. &amp;nbsp;What I need to do is to find out those claimants&amp;nbsp;who are in both sets of data, i.e., Name1=Name2, and were injured on the same date and so Date1=Date2, and then create a new field&amp;nbsp;named as TotalPaid = Paid1+Paid2. &amp;nbsp;That is, I need to find out the total amount of paid for each claimant from both sources. &amp;nbsp;For those claimants exist only in one and not both sets, then TotalPaid=0. &amp;nbsp;The rationale of using these two conditions to set up the new field is because it is not likely that two individuals who got injured&amp;nbsp;on the same date will have the same name. &amp;nbsp;How can I do that? &amp;nbsp;Thanks for helping. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 20:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Compare-fields-in-Two-Different-Datasets/m-p/354605#M82970</guid>
      <dc:creator>docctong</dc:creator>
      <dc:date>2017-04-28T20:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Compare fields in Two Different Datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Compare-fields-in-Two-Different-Datasets/m-p/354609#M82971</link>
      <description>&lt;P&gt;Post sample data and expected output - not real data because you obviously can't release that, but some data that's similar to what you have, especially if you want code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Things that are unclear in your current question:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Do you want the final dataset to have all people, only people in first dataset, only people in second, only people in both?&lt;/LI&gt;
&lt;LI&gt;Are the formats/type the same between the two for merges - they have to be.&lt;/LI&gt;
&lt;LI&gt;When I've&amp;nbsp;worked with medical data and we also used a window, not a specific date=date, because a lot of times a wait in an ER can stretch over midnight which means dates for things may be off by at minimum one date. If this isn't a concern feel free to ignore this comment &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Otherwise this is most likely more easy to accomplish in SQL though a data step merge is also possible.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 20:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Compare-fields-in-Two-Different-Datasets/m-p/354609#M82971</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-28T20:46:37Z</dc:date>
    </item>
  </channel>
</rss>

