<?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: Merge two datasets and remove duplicates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796230#M255484</link>
    <description>Hi there,&lt;BR /&gt;You need to order both datasets by the “by” variable(s) (personid in your case) before the merge step</description>
    <pubDate>Tue, 15 Feb 2022 08:41:36 GMT</pubDate>
    <dc:creator>unison</dc:creator>
    <dc:date>2022-02-15T08:41:36Z</dc:date>
    <item>
      <title>Merge two datasets and remove duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796225#M255483</link>
      <description>&lt;P&gt;I want to merge flu and members data sets then remove duplicates:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table flu&lt;BR /&gt;as select *&lt;BR /&gt;from x.personImmunization&lt;BR /&gt;where (cpt in&lt;BR /&gt;("90630" "90653" "90654" "90655" "90656" "90657" "90658" "90661" "90662" "90666" "90667" "90668" "90673" "90674" "90682" "90685" "90686" "90687" "90688" "90756"&lt;BR /&gt;"G0008" "Q2034" "Q2035" "Q2036" "Q2037" "Q2038" "Q2039"))&lt;BR /&gt;and sourceSystem="xxxx" and immunizationDate between "2020-08-01" and "2021-03-31";&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*get a list of the patients that are in the vaccination list so that we only select their proc codes*/&lt;BR /&gt;/*from personAttribution table*/&lt;BR /&gt;proc sql;&lt;BR /&gt;create table members&lt;BR /&gt;as select *&lt;BR /&gt;from x.personAttribution&lt;BR /&gt;where memberNo in (select patient_id from shp_flu)&lt;BR /&gt;and eligYear in (2020,2021);&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/*merge flu and members tables together and bring back those that are in flu table*/&lt;/P&gt;&lt;P&gt;data vac_list;&lt;BR /&gt;merge flu (IN=A)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; members (IN=B);&lt;BR /&gt;by personid;&lt;BR /&gt;if A and B;&amp;nbsp;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR: BY variables are not properly sorted on data set WORK.MEMBERS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 08:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796225#M255483</guid>
      <dc:creator>bhca60</dc:creator>
      <dc:date>2022-02-15T08:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two datasets and remove duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796230#M255484</link>
      <description>Hi there,&lt;BR /&gt;You need to order both datasets by the “by” variable(s) (personid in your case) before the merge step</description>
      <pubDate>Tue, 15 Feb 2022 08:41:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796230#M255484</guid>
      <dc:creator>unison</dc:creator>
      <dc:date>2022-02-15T08:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Merge two datasets and remove duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796234#M255486</link>
      <description>&lt;P&gt;Please post the&amp;nbsp;&lt;EM&gt;complete&lt;/EM&gt; log from all three steps by copy/pasting it into a window opened with this button:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Feb 2022 09:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-two-datasets-and-remove-duplicates/m-p/796234#M255486</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-15T09:05:17Z</dc:date>
    </item>
  </channel>
</rss>

