<?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 label duplicate cases in data set in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240342#M44311</link>
    <description>&lt;P&gt;My data set has variables user_id and others like v1, v2, .. v5.&lt;/P&gt;
&lt;P&gt;There are some duplicate cases which have the same user_id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there a way to label the duplicate cases, by adding a new variable, value 1 for the primary cases, and value 0 for the second case with the same user_id? By doing this I do not need to delete the duplicate cases, but when analysis I can select the distinct cases by this new variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2015 21:58:38 GMT</pubDate>
    <dc:creator>fengyuwuzu</dc:creator>
    <dc:date>2015-12-21T21:58:38Z</dc:date>
    <item>
      <title>label duplicate cases in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240342#M44311</link>
      <description>&lt;P&gt;My data set has variables user_id and others like v1, v2, .. v5.&lt;/P&gt;
&lt;P&gt;There are some duplicate cases which have the same user_id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is there a way to label the duplicate cases, by adding a new variable, value 1 for the primary cases, and value 0 for the second case with the same user_id? By doing this I do not need to delete the duplicate cases, but when analysis I can select the distinct cases by this new variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 21:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240342#M44311</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2015-12-21T21:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: label duplicate cases in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240347#M44315</link>
      <description>&lt;P&gt;Sort your data if it's not yet in order:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sort data=have;&lt;/P&gt;
&lt;P&gt;by user_id;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it's simple:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;by user_id;&lt;/P&gt;
&lt;P&gt;new_variable = first.user_id;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240347#M44315</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-12-21T22:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: label duplicate cases in data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240351#M44319</link>
      <description>&lt;P&gt;great! this works!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This forum is really good.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2015 22:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/label-duplicate-cases-in-data-set/m-p/240351#M44319</guid>
      <dc:creator>fengyuwuzu</dc:creator>
      <dc:date>2015-12-21T22:14:00Z</dc:date>
    </item>
  </channel>
</rss>

