<?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: Extracting the ID values to remove after identifying duplicate rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785159#M250555</link>
    <description>&lt;P&gt;This gets you what you want, but I'm not sure how you're sorting before this step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
	data = have 
	out = have_nodup nodupkey
	dupout = have_dup;
		by dup_obs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;id dup_obs 
165577390 1 
181429833 2 
520386083 3 
393097972 4 
&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Dec 2021 15:18:50 GMT</pubDate>
    <dc:creator>maguiremq</dc:creator>
    <dc:date>2021-12-09T15:18:50Z</dc:date>
    <item>
      <title>Extracting the ID values to remove after identifying duplicate rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785158#M250554</link>
      <description>&lt;P&gt;Based on duplicate Names and Addresses, I had identified duplicate observations (some individuals are repeated more than twice) and&amp;nbsp;had created a subset of my dataset.&lt;/P&gt;
&lt;P&gt;Each row of my dataset has unique ID values. I want to get the list of the ID values&amp;nbsp;associated with 2nd, 3rd, 4th, ... repetitions of the DUP_OBS to use it in my original dataset and say remove the rows where ID in (the list of ID values)&amp;nbsp;&lt;/P&gt;
&lt;P&gt;DATA WANT;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;SET HAVE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;WHERE ID NOT IN ("&lt;STRONG&gt;313086590", "110616230", "570208047", ..., "359502732"&lt;/STRONG&gt;);&lt;/P&gt;
&lt;P&gt;RUN; *my ID variable is defined as a CHAR variable;&lt;/P&gt;
&lt;P&gt;Eventually, I want to remove the &lt;STRONG&gt;bold&lt;/STRONG&gt; rows in the example table below.&lt;/P&gt;
&lt;P&gt;How may I identify these ID values in my data?&lt;/P&gt;
&lt;P&gt;Thank you for your help.&lt;/P&gt;
&lt;TABLE width="134"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="70"&gt;ID&lt;/TD&gt;
&lt;TD width="64"&gt;DUP_OBS&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;165577390&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;313086590&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;181429833&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;165924338&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;110616230&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;520386083&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;169961292&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;570208047&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;521476491&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;393097972&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;359502732&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 09 Dec 2021 15:12:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785158#M250554</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-12-09T15:12:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting the ID values to remove after identifying duplicate rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785159#M250555</link>
      <description>&lt;P&gt;This gets you what you want, but I'm not sure how you're sorting before this step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
	data = have 
	out = have_nodup nodupkey
	dupout = have_dup;
		by dup_obs;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;id dup_obs 
165577390 1 
181429833 2 
520386083 3 
393097972 4 
&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Dec 2021 15:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785159#M250555</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-12-09T15:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting the ID values to remove after identifying duplicate rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785168#M250559</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/281770"&gt;@maguiremq&lt;/a&gt;&amp;nbsp;.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used a similar method to get to the subset of data with duplicate names and addresses. I need to repeat the step as you suggested. The&amp;nbsp;have_dup dataset would give me the ID values I need to remove from my original data. Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 15:58:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Extracting-the-ID-values-to-remove-after-identifying-duplicate/m-p/785168#M250559</guid>
      <dc:creator>Emma_at_SAS</dc:creator>
      <dc:date>2021-12-09T15:58:04Z</dc:date>
    </item>
  </channel>
</rss>

