<?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: Is there any way to delete duplicate records ina  dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26903#M4825</link>
    <description>Proc Sort with noduplicates option works.&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=dsname out=sorted noduplicates;&lt;BR /&gt;
  by var1 var2 ...;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The noduplicates option removes records that are exactly the same in every variable.&lt;BR /&gt;
The noidupkey option removes records where the by variables are the same.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps.</description>
    <pubDate>Tue, 05 May 2009 02:52:34 GMT</pubDate>
    <dc:creator>barheat</dc:creator>
    <dc:date>2009-05-05T02:52:34Z</dc:date>
    <item>
      <title>Is there any way to delete duplicate records ina  dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26901#M4823</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Is there any way to delete exact duplicate records and write out only one recor from dulplicated set?&lt;BR /&gt;
&lt;BR /&gt;
Say for example my infile has a set of exact 5 duplicate records and I want to delete other 4 and just write out 1 record.&lt;BR /&gt;
&lt;BR /&gt;
thanks,&lt;BR /&gt;
sasbase9</description>
      <pubDate>Mon, 04 May 2009 18:58:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26901#M4823</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-04T18:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to delete duplicate records ina  dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26902#M4824</link>
      <description>Explore PROC SORT and DUPOUT= option.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Mon, 04 May 2009 19:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26902#M4824</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-04T19:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to delete duplicate records ina  dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26903#M4825</link>
      <description>Proc Sort with noduplicates option works.&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=dsname out=sorted noduplicates;&lt;BR /&gt;
  by var1 var2 ...;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
The noduplicates option removes records that are exactly the same in every variable.&lt;BR /&gt;
The noidupkey option removes records where the by variables are the same.&lt;BR /&gt;
&lt;BR /&gt;
Hope this helps.</description>
      <pubDate>Tue, 05 May 2009 02:52:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26903#M4825</guid>
      <dc:creator>barheat</dc:creator>
      <dc:date>2009-05-05T02:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to delete duplicate records ina  dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26904#M4826</link>
      <description>proc sort data=x nodups dupsout=dup;&lt;BR /&gt;
by id;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Now the duplicate obs move to Dup dataset and x has the master</description>
      <pubDate>Tue, 12 May 2009 09:40:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26904#M4826</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-12T09:40:32Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to delete duplicate records ina  dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26905#M4827</link>
      <description>Are you sure?&lt;BR /&gt;
&lt;BR /&gt;
What do you expect the output of this program to be?&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
data have;&lt;BR /&gt;
   input a b c;&lt;BR /&gt;
   cards;&lt;BR /&gt;
1 2 3&lt;BR /&gt;
1 1 3&lt;BR /&gt;
1 2 3&lt;BR /&gt;
;;;;&lt;BR /&gt;
   run;&lt;BR /&gt;
proc sort data=have nodup out=nodups;&lt;BR /&gt;
   by a;&lt;BR /&gt;
   run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
From the online doc.&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;I&gt;If you specify this option, then PROC SORT compares all variable values for each&lt;BR /&gt;
observation to those for the previous observation that was written to the output data set.&lt;BR /&gt;
If an exact match is found, then the observation is not written to the output data set.&lt;/I&gt;[/pre]&lt;BR /&gt;
&lt;BR /&gt;
It goes on to say using BY _ALL_ will result in the expected output...</description>
      <pubDate>Tue, 12 May 2009 11:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26905#M4827</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-05-12T11:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there any way to delete duplicate records ina  dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26906#M4828</link>
      <description>Hi,&lt;BR /&gt;
You can use the following code, if you are not deleting on the basis of any key:&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
	create table Temp2&lt;BR /&gt;
		as&lt;BR /&gt;
	(select * from Temp1&lt;BR /&gt;
		union select * from Temp1);&lt;BR /&gt;
quit;&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 11 Jun 2009 20:55:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-any-way-to-delete-duplicate-records-ina-dataset/m-p/26906#M4828</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-06-11T20:55:48Z</dc:date>
    </item>
  </channel>
</rss>

