<?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: Removing row duplicates  with value in diffrent variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150360#M39649</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks RW9&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Dec 2014 07:02:31 GMT</pubDate>
    <dc:creator>naveen20jan</dc:creator>
    <dc:date>2014-12-16T07:02:31Z</dc:date>
    <item>
      <title>Removing row duplicates  with value in diffrent variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150355#M39644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the below dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data x;&lt;/P&gt;&lt;P&gt;input source $3. fare&amp;nbsp; destination $3.;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;mum 500 del&lt;/P&gt;&lt;P&gt;del 500 mum&lt;/P&gt;&lt;P&gt;kol 600 che&lt;/P&gt;&lt;P&gt;che 600 kol&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want only one oservation for a source and destination ie one obs for to and fro journey for ex&amp;nbsp;&amp;nbsp; out of&amp;nbsp; del and mum and mum to del i need only one, same as for others .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the output should be like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mum 500 del&lt;/P&gt;&lt;P&gt;kol 600 che&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;for the help in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 13:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150355#M39644</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2014-12-15T13:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row duplicates  with value in diffrent variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150356#M39645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How about:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data want;&lt;BR /&gt;&amp;nbsp; set x;&lt;BR /&gt;&amp;nbsp; length forwards backwards $200.;&lt;BR /&gt;&amp;nbsp; forwards=catx(',',source,destination);&lt;BR /&gt;&amp;nbsp; backwards=catx(',',destination,source);&lt;BR /&gt;&amp;nbsp; if forwards=lag(forwards) or forwards=lag(backwards) then delete;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 13:46:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150356#M39645</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-12-15T13:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row duplicates  with value in diffrent variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150357#M39646</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there some order you need to consider ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;
data x;
input source $3. fare&amp;nbsp; destination $3.;
datalines;
mum 500 del
del 500 mum
kol 600 che
che 600 kol
;
run;
data x;
 set x;
 s=source;
 d=destination;
 call sortc(s,d);
run;
proc sort data=x out=want nodupkey;by s d;run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 14:54:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150357#M39646</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-12-15T14:54:42Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row duplicates  with value in diffrent variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150358#M39647</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If your incoming data:&lt;/P&gt;&lt;P&gt;1. already have duplicates&lt;/P&gt;&lt;P&gt;2. same pair of "from-to" do not cluster together (could be any where in the table),&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then to use the solution by &lt;A __default_attr="645292" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;, or the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;data&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; source &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$3.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; fare&amp;nbsp; destination &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: teal; background: white;"&gt;$3.&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;datalines&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;mum 500 del&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;del 500 mum&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;kol 600 che&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;che 600 kol&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;run&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;sql&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;create&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;table&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; want (drop=grp n)&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; *, ifc(source &amp;lt;= destination, cats(source, destination), cats(destination,source)) &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; grp, monotonic() &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; n &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; x&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;group&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; grp&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;having&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; n=min(n)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: navy; background: white; font-family: 'Courier New';"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2014 19:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150358#M39647</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-12-15T19:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row duplicates  with value in diffrent variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150359#M39648</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xai ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for the help and its fine we dont need any order .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 07:01:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150359#M39648</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2014-12-16T07:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing row duplicates  with value in diffrent variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150360#M39649</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks RW9&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2014 07:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Removing-row-duplicates-with-value-in-diffrent-variable/m-p/150360#M39649</guid>
      <dc:creator>naveen20jan</dc:creator>
      <dc:date>2014-12-16T07:02:31Z</dc:date>
    </item>
  </channel>
</rss>

