<?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: Deleting duplicates based on multiple criteria in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/402977#M66869</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Provide more details.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130148"&gt;@lboyd&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;How can I delete duplicates of one variable based on a start date using NODUPKEY?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 10 Oct 2017 22:38:27 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-10T22:38:27Z</dc:date>
    <item>
      <title>Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/402965#M66868</link>
      <description>&lt;P&gt;How can I delete duplicates of one variable based on a start date using NODUPKEY?&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 21:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/402965#M66868</guid>
      <dc:creator>lboyd</dc:creator>
      <dc:date>2017-10-10T21:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/402977#M66869</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Provide more details.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/130148"&gt;@lboyd&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;How can I delete duplicates of one variable based on a start date using NODUPKEY?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2017 22:38:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/402977#M66869</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-10T22:38:27Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403163#M66873</link>
      <description>I've been using this:&lt;BR /&gt;PROC SORT DATA=CMpre DUPOUT=results NODUPKEY ;&lt;BR /&gt;BY QID25;&lt;BR /&gt;RUN ;&lt;BR /&gt;&lt;BR /&gt;where qid25 is an email address. I need to get rid of duplicate email addresses and I want to keep the one that had the earliest start date. Startdate variable looks something like this:&lt;BR /&gt;22JUN17:00:00:00&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Oct 2017 13:42:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403163#M66873</guid>
      <dc:creator>lboyd</dc:creator>
      <dc:date>2017-10-11T13:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403195#M66874</link>
      <description>&lt;P&gt;Sort it twice. First time with email address and date, second with email address and the NODUPKEY option.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 14:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403195#M66874</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-11T14:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403340#M66880</link>
      <description>This code gets rid of missing e-mails, is there a way to prevent that?</description>
      <pubDate>Wed, 11 Oct 2017 19:46:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403340#M66880</guid>
      <dc:creator>lboyd</dc:creator>
      <dc:date>2017-10-11T19:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403352#M66881</link>
      <description>Also some of the e-mails start with an uppercase letter while others start with lower case-is there any way to delete based on both? For instance, if someone said Sam123@gmail.com and also sam123@gmail.com-I'd want one of those deleted from the database.</description>
      <pubDate>Wed, 11 Oct 2017 20:12:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/403352#M66881</guid>
      <dc:creator>lboyd</dc:creator>
      <dc:date>2017-10-11T20:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/404473#M66935</link>
      <description>&lt;BLOCKQUOTE&gt;For instance, if someone said Sam123@gmail.com and also sam123@gmail.com-I'd want one of those deleted from the database.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fix this you need to clean your data first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;This code gets rid of missing e-mails, is there a way to prevent that?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;To deal with this you likely need to do it manually.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;First sort and then use a data step with first/last but coding an exception for the missing emails.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have;
by group_var;
run;

data want;
set have;
by group_var;
if first.group_var or missing(group_var);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 16 Oct 2017 14:52:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/404473#M66935</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-16T14:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: Deleting duplicates based on multiple criteria</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/404474#M66936</link>
      <description>Thank you!</description>
      <pubDate>Mon, 16 Oct 2017 14:52:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Deleting-duplicates-based-on-multiple-criteria/m-p/404474#M66936</guid>
      <dc:creator>lboyd</dc:creator>
      <dc:date>2017-10-16T14:52:57Z</dc:date>
    </item>
  </channel>
</rss>

