<?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: Reg :Duplicates in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13154#M1847</link>
    <description>After sorting your data file in desired order with a BY variable list, then use a DATA step with the two statements IF FIRST.&lt;BREAK_VARIABLE&gt;   and also  IF LAST.&lt;BREAK_VARIABLE&gt;  to identify totally unique one-occurence data conditions, and output those to one file, while also outputting the others to a separate file.&lt;BR /&gt;
&lt;BR /&gt;
Have a look at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website and its SEARCH facility, to search on the words:&lt;BR /&gt;
&lt;BR /&gt;
duplicate by variable&lt;BR /&gt;
&lt;BR /&gt;
and you will find both SAS product documentation and technical reference papers on the topic.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/BREAK_VARIABLE&gt;&lt;/BREAK_VARIABLE&gt;</description>
    <pubDate>Tue, 31 Mar 2009 07:54:33 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2009-03-31T07:54:33Z</dc:date>
    <item>
      <title>Reg :Duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13152#M1845</link>
      <description>i have a data set&lt;BR /&gt;
&lt;BR /&gt;
Data m;&lt;BR /&gt;
input id name $;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 Raju&lt;BR /&gt;
2 nani&lt;BR /&gt;
2 nani&lt;BR /&gt;
2 kool&lt;BR /&gt;
3 india&lt;BR /&gt;
4 usa&lt;BR /&gt;
4usa&lt;BR /&gt;
4usa&lt;BR /&gt;
5 uk&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Now i want the out put into other dataset with out coming of one duplicates to another dataset.the output shd be like this&lt;BR /&gt;
&lt;BR /&gt;
id name&lt;BR /&gt;
1 Raju&lt;BR /&gt;
2 kool&lt;BR /&gt;
3 india&lt;BR /&gt;
5 uk&lt;BR /&gt;
&lt;BR /&gt;
As the 2nani, and 4,usa are alredy repeted that observations shd not come to the new dataset &lt;BR /&gt;
Message was edited by: Main

Message was edited by: Main</description>
      <pubDate>Tue, 31 Mar 2009 06:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13152#M1845</guid>
      <dc:creator>R_Win</dc:creator>
      <dc:date>2009-03-31T06:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :Duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13153#M1846</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
 u will get the desired output by using the following code.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Data m;&lt;BR /&gt;
input id name $;&lt;BR /&gt;
cards;&lt;BR /&gt;
1 Raju&lt;BR /&gt;
2 nani&lt;BR /&gt;
2 nani&lt;BR /&gt;
2 nani&lt;BR /&gt;
3 india&lt;BR /&gt;
4 usa&lt;BR /&gt;
4 usa&lt;BR /&gt;
4 usa&lt;BR /&gt;
5 uk&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=m;&lt;BR /&gt;
by id;&lt;BR /&gt;
run ;&lt;BR /&gt;
&lt;BR /&gt;
data m_new;&lt;BR /&gt;
set m;&lt;BR /&gt;
by id;&lt;BR /&gt;
if first.id ne 1 or last.id ne 1 then delete;&lt;BR /&gt;
else if first.id   then output;&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 31 Mar 2009 07:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13153#M1846</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-31T07:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :Duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13154#M1847</link>
      <description>After sorting your data file in desired order with a BY variable list, then use a DATA step with the two statements IF FIRST.&lt;BREAK_VARIABLE&gt;   and also  IF LAST.&lt;BREAK_VARIABLE&gt;  to identify totally unique one-occurence data conditions, and output those to one file, while also outputting the others to a separate file.&lt;BR /&gt;
&lt;BR /&gt;
Have a look at the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website and its SEARCH facility, to search on the words:&lt;BR /&gt;
&lt;BR /&gt;
duplicate by variable&lt;BR /&gt;
&lt;BR /&gt;
and you will find both SAS product documentation and technical reference papers on the topic.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;/BREAK_VARIABLE&gt;&lt;/BREAK_VARIABLE&gt;</description>
      <pubDate>Tue, 31 Mar 2009 07:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13154#M1847</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-03-31T07:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :Duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13155#M1848</link>
      <description>proc summary data=m n;&lt;BR /&gt;
  by id name;&lt;BR /&gt;
  output out=freq(where=(_FREQ_=1);&lt;BR /&gt;
run;</description>
      <pubDate>Tue, 31 Mar 2009 07:56:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13155#M1848</guid>
      <dc:creator>GertNissen</dc:creator>
      <dc:date>2009-03-31T07:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :Duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13156#M1849</link>
      <description>HI,&lt;BR /&gt;
why can't you try this&lt;BR /&gt;
&lt;BR /&gt;
proc sort data=a  nodupkey out=b;&lt;BR /&gt;
by id name;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data c;&lt;BR /&gt;
set b;&lt;BR /&gt;
if first.id eq 1 then output c;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
or &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
a simple way &lt;BR /&gt;
&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table c as select distinct id,name from b;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
hope it may help you&lt;BR /&gt;
sams</description>
      <pubDate>Wed, 01 Apr 2009 13:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13156#M1849</guid>
      <dc:creator>ssas</dc:creator>
      <dc:date>2009-04-01T13:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: Reg :Duplicates</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13157#M1850</link>
      <description>as your data appear to be approximately in order, you could try[pre]   data reduced ;&lt;BR /&gt;
       set m ;&lt;BR /&gt;
       by  id NOTSORTED ;&lt;BR /&gt;
       if last.id ;&lt;BR /&gt;
   run ;[/pre]This returns the last row in the current order, for each ID.&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Wed, 01 Apr 2009 20:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reg-Duplicates/m-p/13157#M1850</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-04-01T20:13:27Z</dc:date>
    </item>
  </channel>
</rss>

