<?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: Working with duplicates in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669519#M200859</link>
    <description>&lt;P&gt;Use PROC SORT since you need your data sorted anyways - do you need both data sets or just the shown data?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have  nodupkey out=want1 ;
by descending student var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Jul 2020 15:35:01 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2020-07-15T15:35:01Z</dc:date>
    <item>
      <title>Working with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669494#M200846</link>
      <description>&lt;P&gt;I divided a data set into 2 sets based on the value of dup_flag, which was created by sorting on STUDENT. All records in "undup" are unique.&amp;nbsp; All records in "alldup3" are duplicates&lt;/P&gt;
&lt;P&gt;However, in some cases the duplicate can be eliminated, depending on the value of VAR2 in each record. If VAR2 is the same, as in the case of "sam", I can eliminate the dup. The values of VAR3 are irrelevant to this task.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;data I have:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;STUDENT&amp;nbsp; &amp;nbsp; &amp;nbsp;VAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VAR 3&lt;/P&gt;
&lt;P&gt;sam&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trivial&lt;/P&gt;
&lt;P&gt;sam&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trivial&lt;/P&gt;
&lt;P&gt;bob&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trivial&lt;/P&gt;
&lt;P&gt;bob&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trivial&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;data I want:&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;STUDENT&amp;nbsp; &amp;nbsp; &amp;nbsp;VAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VAR 3&lt;/P&gt;
&lt;P&gt;sam&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trivial&lt;/P&gt;
&lt;P&gt;bob&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; trivial&lt;/P&gt;
&lt;P&gt;bob&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;trivial&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data undup alldup3;
	set alldup2;
	if dup_flag='No' then output undup;
	else output alldup3;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 15:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669494#M200846</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2020-07-15T15:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Working with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669519#M200859</link>
      <description>&lt;P&gt;Use PROC SORT since you need your data sorted anyways - do you need both data sets or just the shown data?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort data=have  nodupkey out=want1 ;
by descending student var2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jul 2020 15:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669519#M200859</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-07-15T15:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Working with duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669521#M200860</link>
      <description>&lt;P&gt;I don't need to do anything with the undup data set -- just the set that contains the dups.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 15:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Working-with-duplicates/m-p/669521#M200860</guid>
      <dc:creator>GreggB</dc:creator>
      <dc:date>2020-07-15T15:43:00Z</dc:date>
    </item>
  </channel>
</rss>

