<?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: Where condition in Proc Means in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361438#M85245</link>
    <description>Thank you ..It worked</description>
    <pubDate>Thu, 25 May 2017 00:51:16 GMT</pubDate>
    <dc:creator>Kalai2008</dc:creator>
    <dc:date>2017-05-25T00:51:16Z</dc:date>
    <item>
      <title>Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361396#M85218</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for looking into this.&lt;/P&gt;&lt;P&gt;Need a quick help. I am using Proc Means, where I need to filter only the variable that have countries listed in (H)..That is I need only afghanistan and china. There are more than&amp;nbsp;50 countries listed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ex..Variable Name: bbk_country&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Algeria&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Afghanistan(H)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; China(H)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nigeria&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=Test.Country(&lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(bbk_country&amp;nbsp;in&amp;nbsp;(&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'(H)'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;class bbk_country;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;var amount;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 21:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361396#M85218</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-05-24T21:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361400#M85220</link>
      <description>&lt;P&gt;You may be more limited using the dataset option where than a separate where clause.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use functions in a WHERE statement such as:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;proc&lt;/FONT&gt; &lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;means&lt;/FONT&gt; &lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;data&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;=Test.Country ;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="SAS Monospace" size="2"&gt;where&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt; find(bbk_country,&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'(H)'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="SAS Monospace" size="2"&gt;'i'&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;)&amp;gt;&lt;/FONT&gt;&lt;FONT color="#008080" face="SAS Monospace" size="2"&gt;0&lt;/FONT&gt;&lt;FONT face="SAS Monospace" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="SAS Monospace" size="2"&gt;which would find (H) or (h) with the 'i' option.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 21:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361400#M85220</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-24T21:20:06Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361411#M85225</link>
      <description>&lt;P&gt;&lt;FONT size="3" color="#000080" face="Courier New"&gt;&lt;STRONG&gt;You can try like this if you only want to filter countries that are listed with (H)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" color="#000080" face="Courier New"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; &lt;STRONG&gt;&lt;FONT size="3" color="#000080" face="Courier New"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT size="3" color="#0000ff" face="Courier New"&gt;data&lt;/FONT&gt;&lt;FONT size="3" face="Courier New"&gt;=Test.Country(&lt;/FONT&gt;&lt;FONT size="3" color="#0000ff" face="Courier New"&gt;where&lt;/FONT&gt;&lt;FONT size="3" face="Courier New"&gt;=(bbk_country like &lt;FONT color="#800080"&gt;'%(H)'&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="3" face="Courier New"&gt;));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="Courier New"&gt;class bbk_country;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="Courier New"&gt;var amount;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="3" face="Courier New"&gt;run;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 21:52:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361411#M85225</guid>
      <dc:creator>shanmukh2</dc:creator>
      <dc:date>2017-05-24T21:52:29Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361415#M85228</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc  means data=Test.Country(where=(bbk_country contains '(H)' ));

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2017 22:24:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361415#M85228</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-05-24T22:24:24Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361434#M85243</link>
      <description>&lt;P&gt;IN in SAS is an operator and allows you to search for multiple values. You need to search your string and the appropriate functions for that are FIND/INDEX or LIKE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example of IN&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where country in ('Afghanistan', 'China');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Example of FIND&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where find(country, '(H)')&amp;gt;0;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/86703"&gt;@Kalai2008&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for looking into this.&lt;/P&gt;
&lt;P&gt;Need a quick help. I am using Proc Means, where I need to filter only the variable that have countries listed in (H)..That is I need only afghanistan and china. There are more than&amp;nbsp;50 countries listed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;ex..Variable Name: bbk_country&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Algeria&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Afghanistan(H)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; China(H)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; US&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Nigeria&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;means&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=Test.Country(&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=(bbk_country&amp;nbsp;in&amp;nbsp;(&lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#800080"&gt;'(H)'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;)));&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;class bbk_country;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;var amount;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;Thanks!&lt;/FONT&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 23:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361434#M85243</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-24T23:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361438#M85245</link>
      <description>Thank you ..It worked</description>
      <pubDate>Thu, 25 May 2017 00:51:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361438#M85245</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-05-25T00:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361439#M85246</link>
      <description>Thank you ..It worked..&lt;BR /&gt;I tried before like this...instead I used '%(H)%'</description>
      <pubDate>Thu, 25 May 2017 00:52:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361439#M85246</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-05-25T00:52:24Z</dc:date>
    </item>
    <item>
      <title>Re: Where condition in Proc Means</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361440#M85247</link>
      <description>Thank you..It worked</description>
      <pubDate>Thu, 25 May 2017 00:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Where-condition-in-Proc-Means/m-p/361440#M85247</guid>
      <dc:creator>Kalai2008</dc:creator>
      <dc:date>2017-05-25T00:52:50Z</dc:date>
    </item>
  </channel>
</rss>

