<?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 Help me solve in best way possible without creating extra variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65936#M14308</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
i just need to retain records where for every unique value of var1, &lt;BR /&gt;
if var2 hold values 'g' &amp;amp; 'b' then should reatin rows with value 'g',&lt;BR /&gt;
else if it hold only 'g' all the rows, if only 'b' even all the rows should be retianed,&lt;BR /&gt;
i have enclosed the ouput which would help understand much better.&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
input var1 var2 $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 g&lt;BR /&gt;
1 g&lt;BR /&gt;
1 b&lt;BR /&gt;
1 g&lt;BR /&gt;
2 b&lt;BR /&gt;
2 b&lt;BR /&gt;
3 g&lt;BR /&gt;
3 g&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
o/p&lt;BR /&gt;
1 g&lt;BR /&gt;
1 g&lt;BR /&gt;
1 g&lt;BR /&gt;
2 b&lt;BR /&gt;
2 b&lt;BR /&gt;
3 g&lt;BR /&gt;
3 g&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Sri..</description>
    <pubDate>Fri, 21 Aug 2009 11:42:07 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-08-21T11:42:07Z</dc:date>
    <item>
      <title>Help me solve in best way possible without creating extra variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65936#M14308</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
i just need to retain records where for every unique value of var1, &lt;BR /&gt;
if var2 hold values 'g' &amp;amp; 'b' then should reatin rows with value 'g',&lt;BR /&gt;
else if it hold only 'g' all the rows, if only 'b' even all the rows should be retianed,&lt;BR /&gt;
i have enclosed the ouput which would help understand much better.&lt;BR /&gt;
&lt;BR /&gt;
data a;&lt;BR /&gt;
input var1 var2 $;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1 g&lt;BR /&gt;
1 g&lt;BR /&gt;
1 b&lt;BR /&gt;
1 g&lt;BR /&gt;
2 b&lt;BR /&gt;
2 b&lt;BR /&gt;
3 g&lt;BR /&gt;
3 g&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
o/p&lt;BR /&gt;
1 g&lt;BR /&gt;
1 g&lt;BR /&gt;
1 g&lt;BR /&gt;
2 b&lt;BR /&gt;
2 b&lt;BR /&gt;
3 g&lt;BR /&gt;
3 g&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
Sri..</description>
      <pubDate>Fri, 21 Aug 2009 11:42:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65936#M14308</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-21T11:42:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help me solve in best way possible without creating extra variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65937#M14309</link>
      <description>proc sql;&lt;BR /&gt;
&lt;BR /&gt;
create table two as select a.* from a&lt;BR /&gt;
   where put(var1, 1.)|| var2 in (select put(var1, 1.)|| max(var2) from a group by var1);&lt;BR /&gt;
quit;</description>
      <pubDate>Fri, 21 Aug 2009 12:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65937#M14309</guid>
      <dc:creator>Flip</dc:creator>
      <dc:date>2009-08-21T12:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Help me solve in best way possible without creating extra variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65938#M14310</link>
      <description>Thanks a ton!!</description>
      <pubDate>Mon, 24 Aug 2009 15:49:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Help-me-solve-in-best-way-possible-without-creating-extra/m-p/65938#M14310</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-08-24T15:49:04Z</dc:date>
    </item>
  </channel>
</rss>

