<?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: MORE DUPLICATES!(small change) in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29913#M7052</link>
    <description>Let's consider Table name :MAST_CS;&lt;BR /&gt;
contains field1,field2,field3,field4.. as fields say...last_name , first_name, date_of_birth, idnumber&lt;BR /&gt;
1.using same table mapped to conditions as "NOT EQUAL " field values for Duplicates removal&lt;BR /&gt;
2.using same table mapped to conditions as " EQUAL " field values for displaying only Duplicates &lt;BR /&gt;
1.OUT1 dataset contains elimination of duplicate entries&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table mynodups as &lt;BR /&gt;
SELECT distinct Table1.field1,Table1.field2,Table1.field3,Table1.field4 &lt;BR /&gt;
FROM MAST_CS Table1,MAST_CS Table2 &lt;BR /&gt;
WHERE Table1.field1 NOT EQUAL Table2.field1 &lt;BR /&gt;
AND Table1.field2 NOT EQUAL Table2.field2&lt;BR /&gt;
AND Table1.field3 NOT EQUAL Table2.field3 &lt;BR /&gt;
AND Table1.field4 NOT EQUAL Table2.field 4;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Data out1;&lt;BR /&gt;
set work.mynodups;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
2.OUT2 dataset contains only duplicate entries&lt;BR /&gt;
&lt;BR /&gt;
Displaying Duplicates alone:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
create table mydupsonly as &lt;BR /&gt;
SELECT distinct Table1.field1,Table1.field2,Table1.field3,Table1.field4 &lt;BR /&gt;
FROM MAST_CS Table1,MAST_CS Table2 &lt;BR /&gt;
&lt;BR /&gt;
WHERE Table1.field1 == Table2.field1 &lt;BR /&gt;
AND Table1.field2 == Table2.field2&lt;BR /&gt;
AND Table1.field3 == Table2.field3 &lt;BR /&gt;
AND Table1.field4 == Table2.field 4;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Data out2;&lt;BR /&gt;
set work.mydupsonly;&lt;BR /&gt;
run;</description>
    <pubDate>Mon, 11 May 2009 08:40:40 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-05-11T08:40:40Z</dc:date>
    <item>
      <title>MORE DUPLICATES!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29910#M7049</link>
      <description>Hi, just when I thought I was ready to merge I found more duplicates within my dataset. I have learned how to pull out duplicates based on one variable, but how can I pull out duplicate values where many conditions are true? For example I want to know when there are duplicate occurences of last name, first name, date of birth, and idnumber (all together). I don't know or care right now whether the other variables surrounding these four are the same or different; I just want to know if those four are equal in more than one observation, and if they are, to create a separate dataset so that I can look at them.&lt;BR /&gt;
&lt;BR /&gt;
Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 11 May 2009 01:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29910#M7049</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-11T01:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29911#M7050</link>
      <description>Try this!&lt;BR /&gt;
&lt;BR /&gt;
proc sort data = x out = tmp dupout = dup nodupkey;&lt;BR /&gt;
 by last_name first_name  date_of_birth idnumber;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Dataset dup will contain your duplicates and tmp the rest...&lt;BR /&gt;
//Fredrik</description>
      <pubDate>Mon, 11 May 2009 07:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29911#M7050</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2009-05-11T07:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29912#M7051</link>
      <description>Any suggestions &amp;amp; issues...&lt;BR /&gt;
plz feel free to contact

Message was edited by: giri2help</description>
      <pubDate>Mon, 11 May 2009 08:36:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29912#M7051</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-11T08:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!(small change)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29913#M7052</link>
      <description>Let's consider Table name :MAST_CS;&lt;BR /&gt;
contains field1,field2,field3,field4.. as fields say...last_name , first_name, date_of_birth, idnumber&lt;BR /&gt;
1.using same table mapped to conditions as "NOT EQUAL " field values for Duplicates removal&lt;BR /&gt;
2.using same table mapped to conditions as " EQUAL " field values for displaying only Duplicates &lt;BR /&gt;
1.OUT1 dataset contains elimination of duplicate entries&lt;BR /&gt;
proc sql;&lt;BR /&gt;
create table mynodups as &lt;BR /&gt;
SELECT distinct Table1.field1,Table1.field2,Table1.field3,Table1.field4 &lt;BR /&gt;
FROM MAST_CS Table1,MAST_CS Table2 &lt;BR /&gt;
WHERE Table1.field1 NOT EQUAL Table2.field1 &lt;BR /&gt;
AND Table1.field2 NOT EQUAL Table2.field2&lt;BR /&gt;
AND Table1.field3 NOT EQUAL Table2.field3 &lt;BR /&gt;
AND Table1.field4 NOT EQUAL Table2.field 4;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Data out1;&lt;BR /&gt;
set work.mynodups;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
2.OUT2 dataset contains only duplicate entries&lt;BR /&gt;
&lt;BR /&gt;
Displaying Duplicates alone:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
create table mydupsonly as &lt;BR /&gt;
SELECT distinct Table1.field1,Table1.field2,Table1.field3,Table1.field4 &lt;BR /&gt;
FROM MAST_CS Table1,MAST_CS Table2 &lt;BR /&gt;
&lt;BR /&gt;
WHERE Table1.field1 == Table2.field1 &lt;BR /&gt;
AND Table1.field2 == Table2.field2&lt;BR /&gt;
AND Table1.field3 == Table2.field3 &lt;BR /&gt;
AND Table1.field4 == Table2.field 4;&lt;BR /&gt;
&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
Data out2;&lt;BR /&gt;
set work.mydupsonly;&lt;BR /&gt;
run;</description>
      <pubDate>Mon, 11 May 2009 08:40:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29913#M7052</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-11T08:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!(small change)</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29914#M7053</link>
      <description>Thanks for the suggestion! I get the same exact table, however, either way with the same number of observations in each? I.e. I get the "no dups" result with both tables. &lt;BR /&gt;
&lt;BR /&gt;
Also...if I do it this way and it works, will it allow me to see the duplicate pairs? Or just one member of a duplicate pair? Thanks so much!!&lt;BR /&gt;
&lt;BR /&gt;
Emily</description>
      <pubDate>Mon, 11 May 2009 20:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29914#M7053</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-11T20:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29915#M7054</link>
      <description>Thanks for the help! I may not be doing things right, but when I use the code you provided, I get only one of the duplicates from each 'pair' of duplicates in dataset dup. Is that correct?&lt;BR /&gt;
What I'd like to see is all the duplicate occurences together so I can see what went wrong.&lt;BR /&gt;
&lt;BR /&gt;
Is this possible?&lt;BR /&gt;
&lt;BR /&gt;
For example, if I have John Doe 1/1/01 #333 and John Doe 1/1/01 #333 I'd like to see those two together (along with the rest of the variables surrounding them) to see if it is a duplicate entry or not.&lt;BR /&gt;
&lt;BR /&gt;
Suggestions?</description>
      <pubDate>Mon, 11 May 2009 20:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29915#M7054</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-11T20:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!(change )</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29916#M7055</link>
      <description>Reg:- Duplicate Pairs&lt;BR /&gt;
Distinct will produce without duplicates ...so u r getting same in both tables..&lt;BR /&gt;
check without using distinct keyword... for duplicates...&lt;BR /&gt;
&lt;BR /&gt;
If u want to see only duplicates with pairs..remove distinct keyword &amp;amp; u can see the variation of results in select query...Hope this is what u expect i think ..&lt;BR /&gt;
&lt;BR /&gt;
Any clarifications let me know plz...&lt;BR /&gt;
giridhar</description>
      <pubDate>Tue, 12 May 2009 06:08:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29916#M7055</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-12T06:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!(change )</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29917#M7056</link>
      <description>I can't seem to get that to work. Thanks so much for your help, though. I'm trying a different approach, and I think this is a very simple thing to do: how can I pull out 35 observations that meet a certain criteria?&lt;BR /&gt;
&lt;BR /&gt;
For example, I located the duplicate numbers. I have the list. So I want to create a dataset that includes observations containing variables of certain values only. I want to pull the following IDs:&lt;BR /&gt;
&lt;BR /&gt;
MN-1233&lt;BR /&gt;
MN-14354&lt;BR /&gt;
MN-1515&lt;BR /&gt;
MN-3535&lt;BR /&gt;
&lt;BR /&gt;
I can't seem to get the "where" or "if" statements to work with this.....&lt;BR /&gt;
Help??? This one should be easy....I'm just such a novice and getting frustrated.&lt;BR /&gt;
Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Tue, 12 May 2009 19:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29917#M7056</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-12T19:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: MORE DUPLICATES!(change )</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29918#M7057</link>
      <description>this provides one way to select cases from a table.&lt;BR /&gt;
DATA SELECTED ;&lt;BR /&gt;
   set original ;&lt;BR /&gt;
   where ID in( 'MN-1233', 'MN-14354', 'MN-1515', 'MN-3535' );&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
This collects duplicates from a table in the key order;&lt;BR /&gt;
DATA DUPLICATES ;&lt;BR /&gt;
   set original ;&lt;BR /&gt;
   by  ID ;&lt;BR /&gt;
   if first.id and last.id then delete ; * removing singletons ;&lt;BR /&gt;
run ;&lt;BR /&gt;
 &lt;BR /&gt;
hope it helps</description>
      <pubDate>Wed, 13 May 2009 11:28:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/MORE-DUPLICATES/m-p/29918#M7057</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-05-13T11:28:17Z</dc:date>
    </item>
  </channel>
</rss>

