<?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 Keeping only duplicates with proc sort with more than one variable in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344660#M273055</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a code to get only duplicates using proc sort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I need to get the duplicates with more variables ..example var1, var2, var3, var4 ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somebody how to do it??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
     data = test;
     by var1;
run;


data single dup;
     set test;
     by var1;
     if first.var1 and last.var1 
          then output single;
     else output dup;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 27 Mar 2017 15:12:01 GMT</pubDate>
    <dc:creator>Jcorti</dc:creator>
    <dc:date>2017-03-27T15:12:01Z</dc:date>
    <item>
      <title>Keeping only duplicates with proc sort with more than one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344660#M273055</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found a code to get only duplicates using proc sort.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I need to get the duplicates with more variables ..example var1, var2, var3, var4 ..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Somebody how to do it??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
     data = test;
     by var1;
run;


data single dup;
     set test;
     by var1;
     if first.var1 and last.var1 
          then output single;
     else output dup;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:12:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344660#M273055</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-03-27T15:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping only duplicates with proc sort with more than one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344670#M273056</link>
      <description>&lt;P&gt;You need to define what you mean by duplicate? Preferably provide some example data and an indication of which you consider duplicates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:40:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344670#M273056</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-27T15:40:12Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping only duplicates with proc sort with more than one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344672#M273057</link>
      <description>&lt;P&gt;A small variation on your program ought to do the trick:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sort&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; test&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; var1 &lt;FONT color="#00ff00"&gt;var2 var3 var4&lt;/FONT&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt; single dup&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token keyword"&gt;set&lt;/SPAN&gt; test&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token statement"&gt;by&lt;/SPAN&gt; var1 &lt;FONT color="#00ff00"&gt;var2 var3 var4&lt;/FONT&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;first&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;var&lt;FONT color="#00ff00"&gt;4&lt;/FONT&gt; and last&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;var&lt;FONT color="#00ff00"&gt;4&lt;/FONT&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token keyword"&gt;then&lt;/SPAN&gt; output single&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="token keyword"&gt;else&lt;/SPAN&gt; output dup&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this doesn't do it, you might need to answer some of the questions already asked, like the meaning of a duplicate.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:46:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344672#M273057</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-03-27T15:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping only duplicates with proc sort with more than one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344870#M273058</link>
      <description>&lt;PRE&gt;
proc sort
     data = test  out=want  nouniquekey  ;
     by var1 var2 var3 var4;
run;

&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2017 04:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/344870#M273058</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2017-03-28T04:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Keeping only duplicates with proc sort with more than one variable</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/345062#M273059</link>
      <description>&lt;P&gt;Thanks for your solution&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 16:31:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Keeping-only-duplicates-with-proc-sort-with-more-than-one/m-p/345062#M273059</guid>
      <dc:creator>Jcorti</dc:creator>
      <dc:date>2017-03-28T16:31:22Z</dc:date>
    </item>
  </channel>
</rss>

