<?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 search for/ remove subjects (rows) with matching IDs in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534207#M146542</link>
    <description>&lt;P&gt;For part 2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* UNTESTED CODE */
proc sql;
    create table want as select * from have 
        group by subject having count(subject)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 09 Feb 2019 23:54:42 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-02-09T23:54:42Z</dc:date>
    <item>
      <title>how to search for/ remove subjects (rows) with matching IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534206#M146541</link>
      <description>&lt;P&gt;hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a large data set that includes multiple rows for some subjects. Can anyone tell me how to (1) view all of the entries for which this is the case and (2) remove all entries except for the first one for each subject, And ideally place them in a different data set?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tia for any help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;leslie&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 23:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534206#M146541</guid>
      <dc:creator>amigapomba</dc:creator>
      <dc:date>2019-02-09T23:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to search for/ remove subjects (rows) with matching IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534207#M146542</link>
      <description>&lt;P&gt;For part 2:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* UNTESTED CODE */
proc sql;
    create table want as select * from have 
        group by subject having count(subject)=1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 23:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534207#M146542</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-09T23:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: how to search for/ remove subjects (rows) with matching IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534214#M146547</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/251357"&gt;@amigapomba&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc Sort should give you an easy option to implement such logic.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  do subject=3,2,4,1,1,3,2,2;
    otherVar+1;
    output;
  end;
  stop;
run;

proc sort nodupkey
  data=have 
  out=firstSubj  
  dupout=dupSubj 
  ;
  by subject;
run;

title 'firstSubj';
proc print data=firstSubj;
run;
title 'dupSubj';
proc print data=dupSubj;
run;
title;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 199px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/27031iD1102D72209BC9AB/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534214#M146547</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2019-02-10T00:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to search for/ remove subjects (rows) with matching IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534241#M146567</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 01:32:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534241#M146567</guid>
      <dc:creator>amigapomba</dc:creator>
      <dc:date>2019-02-10T01:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to search for/ remove subjects (rows) with matching IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534242#M146568</link>
      <description>&lt;P&gt;Thank you! I am not sure I need to delete yet so I have not tried your code. does it remove all entries where count&amp;gt;1, including first?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;leslie&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 01:42:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534242#M146568</guid>
      <dc:creator>amigapomba</dc:creator>
      <dc:date>2019-02-10T01:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to search for/ remove subjects (rows) with matching IDs</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534285#M146601</link>
      <description>&lt;P&gt;You are correct, and so I withdraw my solution.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 12:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-search-for-remove-subjects-rows-with-matching-IDs/m-p/534285#M146601</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-02-10T12:25:23Z</dc:date>
    </item>
  </channel>
</rss>

