<?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: Remove duplicate records without missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292114#M60581</link>
    <description>&lt;PRE&gt;
OK. If there are other non missing value in a group , which you want keep:



data have;
infile cards truncover expandtabs;
input id x;
cards;
1234	12
1234	 
1234	 
1235	13
1235	13
1235    12
1235    
1236	11
1237	 
1237	 
1237	 
1237	10
1238	 
1238	 
;
run;
proc sort data=have;
 by id descending x;
run;
data want;
 set have;
 by id descending x ;
 if first.x and not missing(x) or first.id;
run;


&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Aug 2016 10:16:12 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-08-17T10:16:12Z</dc:date>
    <item>
      <title>Remove duplicate records without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292032#M60545</link>
      <description>&lt;P&gt;&amp;nbsp;I want to remove the duplicate records but the ones that have missing values as follows&lt;/P&gt;&lt;P&gt;Input&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1234&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1235&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&l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&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 00:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292032#M60545</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-08-17T00:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate records without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292034#M60547</link>
      <description>&lt;PRE&gt;

data have;
infile cards truncover expandtabs;
input id x;
cards;
1234	12
1234	 
1234	 
1235	13
1235	13
1236	11
1237	 
1237	 
1237	 
1237	10
1238	 
1238	 
;
run;
proc sort data=have;
 by id descending x;
run;
data want;
 set have;
 by id;
 if first.id;
run;

&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 01:14:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292034#M60547</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-17T01:14:32Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate records without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292036#M60549</link>
      <description>&lt;P&gt;Use the fact that missing values are inferior to all non-missing but are not included in the evaluation of MIN:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
infile datalines missover;
input a b;
datalines;
1234	12
1234	 
1234	 
1235	13
1235	13
1236	11
1237	 
1237	 
1237	 
1237	10
1238	 
1238	 
;

proc sql;
select unique *
from test
group by a
having b &amp;gt;= min(b);
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 01:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292036#M60549</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-17T01:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate records without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292058#M60558</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/462"&gt;@PGStats﻿&lt;/a&gt;&amp;nbsp;:&amp;nbsp;Its not working for&amp;nbsp;the records where 'b' in all the duplicate records is&amp;nbsp;missing&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 03:22:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292058#M60558</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-08-17T03:22:52Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate records without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292059#M60559</link>
      <description>&lt;P&gt;I get the result&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;                                        a         b
                                 --------------------------
                                     1234        12
                                     1235        13
                                     1236        11
                                     1237        10
                                     1238         .
&lt;/PRE&gt;
&lt;P&gt;case where a=1238 seems to be handled properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp﻿&lt;/a&gt;'s solution would not return the case 1235 12, which is not a duplicate, if it was present in your data.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 03:31:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292059#M60559</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-17T03:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Remove duplicate records without missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292114#M60581</link>
      <description>&lt;PRE&gt;
OK. If there are other non missing value in a group , which you want keep:



data have;
infile cards truncover expandtabs;
input id x;
cards;
1234	12
1234	 
1234	 
1235	13
1235	13
1235    12
1235    
1236	11
1237	 
1237	 
1237	 
1237	10
1238	 
1238	 
;
run;
proc sort data=have;
 by id descending x;
run;
data want;
 set have;
 by id descending x ;
 if first.x and not missing(x) or first.id;
run;


&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Aug 2016 10:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-duplicate-records-without-missing-values/m-p/292114#M60581</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-08-17T10:16:12Z</dc:date>
    </item>
  </channel>
</rss>

