<?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: Filtering data by two variables in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607601#M17568</link>
    <description>&lt;P&gt;The simplest way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
  data=have
  out=want
  nodupkey
;
by a b c;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Nov 2019 10:05:45 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-11-27T10:05:45Z</dc:date>
    <item>
      <title>Filtering data by two variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607596#M17564</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;I have somewhat of a problem that I could not find a solution for.&lt;/P&gt;&lt;P&gt;I want to filter out datalines where variable A is not unique for any different variable B and C combination so that only one dataline remain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;A B C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&lt;FONT color="#FF6600"&gt; 2 3 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;2&amp;nbsp; &lt;FONT color="#FF0000"&gt;2 3 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;3&amp;nbsp; &lt;FONT color="#339966"&gt;2 4 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;4&amp;nbsp;&lt;FONT color="#339966"&gt; 2 5 4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;5&amp;nbsp; &lt;FONT color="#FF6600"&gt;3 1 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;6&amp;nbsp; &lt;FONT color="#339966"&gt;3 2 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;7&amp;nbsp; &lt;FONT color="#FF0000"&gt;3 1 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt;A B C&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;1&amp;nbsp; 2 3 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;2&amp;nbsp; 2 4 5&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;3&amp;nbsp; 2 5 4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF6600"&gt;4&amp;nbsp; 3 1 2&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;5&amp;nbsp; 3 2 1&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would much apreciate any help!&lt;/P&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:01:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607596#M17564</guid>
      <dc:creator>Viktoreli</dc:creator>
      <dc:date>2019-11-27T10:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data by two variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607599#M17566</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input A:8. B:8. C:8.;
datalines;
2 3 5
2 3 5
2 4 5
2 5 4
3 1 2
3 2 1
3 1 2
;
run;

proc sort data=have nodupkey out=want;
by a b c;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:05:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607599#M17566</guid>
      <dc:creator>sustagens</dc:creator>
      <dc:date>2019-11-27T10:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data by two variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607600#M17567</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/291193"&gt;@Viktoreli&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this::&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input A B C;
	cards;
2 3 5
2 3 5
2 4 5
2 5 4
3 1 2
3 2 1
3 1 2
;
run;

proc sort data=have;
	by A B C;
run;

data want;
	set have;
	by A B C;
	if first.C then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:05:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607600#M17567</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-11-27T10:05:34Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data by two variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607601#M17568</link>
      <description>&lt;P&gt;The simplest way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sort
  data=have
  out=want
  nodupkey
;
by a b c;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607601#M17568</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-27T10:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Filtering data by two variables</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607603#M17569</link>
      <description>&lt;P&gt;And the SQL version:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table want as
select distinct *
from have;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Nov 2019 10:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Filtering-data-by-two-variables/m-p/607603#M17569</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-11-27T10:07:05Z</dc:date>
    </item>
  </channel>
</rss>

