<?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: reduce a data base on time point in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356743#M64258</link>
    <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Sun, 07 May 2017 21:07:37 GMT</pubDate>
    <dc:creator>desireatem</dc:creator>
    <dc:date>2017-05-07T21:07:37Z</dc:date>
    <item>
      <title>Keep records that are duplicated - remove unique records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356726#M64255</link>
      <description>&lt;P&gt;Hello ,&lt;/P&gt;
&lt;P&gt;I want to create data "B" from data "A". That is , I want to keep only data with at least two time points;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data a,
Input id timepoint;
Cards;
001 &amp;nbsp; &amp;nbsp; 1
001 &amp;nbsp; &amp;nbsp; 2
001 &amp;nbsp; &amp;nbsp; 3
002 &amp;nbsp; &amp;nbsp;1
003 &amp;nbsp; &amp;nbsp;1
003 &amp;nbsp; &amp;nbsp;2
004 &amp;nbsp; &amp;nbsp;1
005 &amp;nbsp; &amp;nbsp;1
;
&amp;nbsp;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Data "B" is created from data "A". id 002 , 004 and 005 are dropped because they are just one time points.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data B;
Input id timepoint;
Cards;
&amp;nbsp;
001 &amp;nbsp; &amp;nbsp; 1
001 &amp;nbsp; &amp;nbsp; 2
001 &amp;nbsp; &amp;nbsp; 3
&amp;nbsp;
003 &amp;nbsp; &amp;nbsp;1
003 &amp;nbsp; &amp;nbsp;2
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 19:09:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356726#M64255</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2017-05-07T19:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: reduce a data base on time point</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356727#M64256</link>
      <description>&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table b as&lt;/P&gt;&lt;P&gt;select *&lt;/P&gt;&lt;P&gt;from a&lt;/P&gt;&lt;P&gt;group by id&lt;/P&gt;&lt;P&gt;having count(id)&amp;gt;1;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 18:20:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356727#M64256</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2017-05-07T18:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Keep records that are duplicated - remove unique records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356731#M64257</link>
      <description>&lt;P&gt;You can use the NOUNIQUEKEY option on PROC SORT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
     data = sashelp.adomsg
          out = duplicates
          &lt;STRONG&gt;uniqueout = singles&lt;/STRONG&gt;
          nouniquekey;
     by msgid;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 May 2017 19:11:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356731#M64257</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-07T19:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: reduce a data base on time point</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356743#M64258</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 07 May 2017 21:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356743#M64258</guid>
      <dc:creator>desireatem</dc:creator>
      <dc:date>2017-05-07T21:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Keep records that are duplicated - remove unique records</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356760#M64259</link>
      <description>&lt;P&gt;With datastep as well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data a2;
do until(last.id);
set a;
by id timepoint;
if first.id then count=1;
else count+1;
end;
do until(last.id);
set a;
by id timepoint;
if count&amp;gt;1 then output ;
end;
run;

 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 May 2017 02:11:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Keep-records-that-are-duplicated-remove-unique-records/m-p/356760#M64259</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2017-05-08T02:11:31Z</dc:date>
    </item>
  </channel>
</rss>

