<?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 remove duplicate records and place them into a new data set simultaneously in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47974#M9923</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data person;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input id $ name $ dept $;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;BR /&gt;1 John Sales&lt;BR /&gt;2 Mary Acctng&lt;BR /&gt;3 Tom&amp;nbsp; Marketing&lt;BR /&gt;1 John Sales&lt;BR /&gt;3 Tom&amp;nbsp; Marketing&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = person; BY id;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE TEST AS&lt;BR /&gt;SELECT DISTINCT * FROM person GROUP BY ID HAVING COUNT(ID) GT 1;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = person NODUPKEY; BY id;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Feb 2012 20:19:46 GMT</pubDate>
    <dc:creator>Hima</dc:creator>
    <dc:date>2012-02-07T20:19:46Z</dc:date>
    <item>
      <title>How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47969#M9918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a data set with millions of records and i want to remove the duplicates from that and place them into a new data set.&lt;/P&gt;&lt;P&gt;I need different scenarios like using proc sort and other techniques.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vishnu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 17:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47969#M9918</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2012-02-07T17:06:07Z</dc:date>
    </item>
    <item>
      <title>How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47970#M9919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends upon what you want to remove and if you want to have total control over what is removed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My own preference is to use proc sort and then, in a datastep, take advantage of the first. and last. boolean variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 17:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47970#M9919</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-07T17:10:44Z</dc:date>
    </item>
    <item>
      <title>How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47971#M9920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at the dupout option in proc sort to see if it meets your needs, it does not offer the same level of control as Art's recommendation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146878.htm"&gt;http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/viewer.htm#a000146878.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 17:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47971#M9920</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2012-02-07T17:33:17Z</dc:date>
    </item>
    <item>
      <title>How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47972#M9921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Remember if you use SORT with NODUPLICATES (or SORT followed by FIRST. and LAST.) that you must have a sufficient key to bring the duplicate records next to each other or they will not be eliminated. This paper has been around a while but is still important today:&amp;nbsp; &lt;A href="http://www2.sas.com/proceedings/sugi25/25/po/25p221.pdf"&gt;http://www2.sas.com/proceedings/sugi25/25/po/25p221.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 18:22:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47972#M9921</guid>
      <dc:creator>ArtC</dc:creator>
      <dc:date>2012-02-07T18:22:35Z</dc:date>
    </item>
    <item>
      <title>How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47973#M9922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would add that there aren't many (if any) use(s) I've ever seen for the noduplicates option.&amp;nbsp; If I were to use the dupout option, I would always use it with NODUPKEY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 18:26:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47973#M9922</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-02-07T18:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47974#M9923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data person;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; input id $ name $ dept $;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;BR /&gt;1 John Sales&lt;BR /&gt;2 Mary Acctng&lt;BR /&gt;3 Tom&amp;nbsp; Marketing&lt;BR /&gt;1 John Sales&lt;BR /&gt;3 Tom&amp;nbsp; Marketing&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = person; BY id;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;/P&gt;&lt;P&gt;CREATE TABLE TEST AS&lt;BR /&gt;SELECT DISTINCT * FROM person GROUP BY ID HAVING COUNT(ID) GT 1;&lt;BR /&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SORT DATA = person NODUPKEY; BY id;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Feb 2012 20:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47974#M9923</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-02-07T20:19:46Z</dc:date>
    </item>
    <item>
      <title>How to remove duplicate records and place them into a new data set simultaneously</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47975#M9924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Art,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this was really helpful..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Feb 2012 09:47:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-remove-duplicate-records-and-place-them-into-a-new-data/m-p/47975#M9924</guid>
      <dc:creator>Vish33</dc:creator>
      <dc:date>2012-02-08T09:47:05Z</dc:date>
    </item>
  </channel>
</rss>

