<?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: why using 'where' instead of 'if' ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762596#M241473</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You can only use if in data step. Proc, you have to use where statement.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I might modify that "only use IF to subset data in a data step".&lt;/P&gt;
&lt;P&gt;A few procedures have places where "IF" is used for things other than subsetting data.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Aug 2021 16:48:31 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-08-19T16:48:31Z</dc:date>
    <item>
      <title>why using 'where' instead of 'if' ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762576#M241467</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data groups;
set cert.input48;
if upcase(cvar) in ('A','B','C','D','E','F','G') then group=1;
else if upcase(cvar) in ('H','I','J','K','L','M','N') then group=2;
else group=3;
numy=input(y,10.);
run;
proc means data=groups mean maxdec=0;
var numy;
where group=2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;where group=2&amp;nbsp; , why is not using 'if' ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 15:56:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762576#M241467</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-08-19T15:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: why using 'where' instead of 'if' ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762581#M241468</link>
      <description>&lt;P&gt;You &lt;STRONG&gt;can't&lt;/STRONG&gt; use IF to subset your dataset within PROC MEANS. You can only use WHERE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In DATA steps, using WHERE on the SET statement usually allows for faster processing by only reading in observations that fit the condition. Using IF requires reading in all observations and then subsetting based on that condition.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 16:00:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762581#M241468</guid>
      <dc:creator>maguiremq</dc:creator>
      <dc:date>2021-08-19T16:00:21Z</dc:date>
    </item>
    <item>
      <title>Re: why using 'where' instead of 'if' ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762589#M241471</link>
      <description>&lt;P&gt;You can only use if in data step. Proc, you have to use where statement.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 16:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762589#M241471</guid>
      <dc:creator>tarheel13</dc:creator>
      <dc:date>2021-08-19T16:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: why using 'where' instead of 'if' ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762596#M241473</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181158"&gt;@tarheel13&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You can only use if in data step. Proc, you have to use where statement.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I might modify that "only use IF to subset data in a data step".&lt;/P&gt;
&lt;P&gt;A few procedures have places where "IF" is used for things other than subsetting data.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 16:48:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762596#M241473</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-08-19T16:48:31Z</dc:date>
    </item>
    <item>
      <title>Re: why using 'where' instead of 'if' ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762616#M241477</link>
      <description>&lt;P&gt;Thank you for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Aug 2021 17:52:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/why-using-where-instead-of-if/m-p/762616#M241477</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-08-19T17:52:53Z</dc:date>
    </item>
  </channel>
</rss>

