<?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: would you code a select construct instead Of If Statements in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537395#M147805</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253245"&gt;@rinugour&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;Under what circumstances would you code a select construct instead Of If Statements?&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As soon as it makes the code more readable. If in doubt, put both versions side-by-side and see which one looks better to you.&lt;/P&gt;
&lt;P&gt;A potential performance gain has to be determined through testing (in most cases, there won't be a noticeable difference).&lt;/P&gt;</description>
    <pubDate>Thu, 21 Feb 2019 14:00:26 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2019-02-21T14:00:26Z</dc:date>
    <item>
      <title>would you code a select construct instead Of If Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537369#M147790</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Under what circumstances would you code a select construct instead Of If Statements?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 12:42:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537369#M147790</guid>
      <dc:creator>rinugour</dc:creator>
      <dc:date>2019-02-21T12:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: would you code a select construct instead Of If Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537378#M147793</link>
      <description>&lt;P&gt;That's really up to you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For binary choices, then use ifc() or ifn() functions.&lt;/P&gt;
&lt;P&gt;For simple if constructs with three or four branches then if statements.&lt;/P&gt;
&lt;P&gt;For over 4 consider select.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are no rules on this, if you prefer if statements, then use them.&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:09:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537378#M147793</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-21T13:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: would you code a select construct instead Of If Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537383#M147795</link>
      <description>&lt;P&gt;Whenever I have a calculated construct that is reused in simple cases, e.g.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;select(month(date3));
  when(12,1,2) season="Winter";
  when(3,4,5) season="Spring";
  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A very simple example, but with an IF statement you would have to repeat the month calculation, or insert an extra line to assign it to a variable (and one more line to drop the unneeded month variable).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It can also be a nice way to throw an error if something unexpected shows up, just omit the OTHERWISE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 13:22:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537383#M147795</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-02-21T13:22:38Z</dc:date>
    </item>
    <item>
      <title>Re: would you code a select construct instead Of If Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537395#M147805</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/253245"&gt;@rinugour&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;Under what circumstances would you code a select construct instead Of If Statements?&lt;/STRONG&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As soon as it makes the code more readable. If in doubt, put both versions side-by-side and see which one looks better to you.&lt;/P&gt;
&lt;P&gt;A potential performance gain has to be determined through testing (in most cases, there won't be a noticeable difference).&lt;/P&gt;</description>
      <pubDate>Thu, 21 Feb 2019 14:00:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/537395#M147805</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-02-21T14:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: would you code a select construct instead Of If Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/538229#M148153</link>
      <description>If more number of variables are dependent on some similar nested conditions, it is better to go with if rather than case.</description>
      <pubDate>Mon, 25 Feb 2019 09:16:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/538229#M148153</guid>
      <dc:creator>Satish_Parida</dc:creator>
      <dc:date>2019-02-25T09:16:23Z</dc:date>
    </item>
    <item>
      <title>Re: would you code a select construct instead Of If Statements</title>
      <link>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/538935#M148414</link>
      <description>&lt;P&gt;The select statement is used when you are using one condition to compare with several conditions like.&lt;/P&gt;&lt;DIV class="EnlighterJSWrapper enlighterEnlighterJSWrapper"&gt;&lt;OL&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Data exam;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;Set exam;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class="kw1"&gt;select&lt;/SPAN&gt; &lt;SPAN class="br0"&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;pass&lt;/SPAN&gt;&lt;SPAN class="br0"&gt;)&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;when Physics gt &lt;/SPAN&gt;&lt;SPAN class="nu0"&gt;60&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;when math gt &lt;/SPAN&gt;&lt;SPAN class="nu0"&gt;100&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;when English eq &lt;/SPAN&gt;&lt;SPAN class="nu0"&gt;50&lt;/SPAN&gt;&lt;SPAN class=""&gt;;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;otherwise fail;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN class=""&gt;run;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Feb 2019 12:18:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/would-you-code-a-select-construct-instead-Of-If-Statements/m-p/538935#M148414</guid>
      <dc:creator>anjita</dc:creator>
      <dc:date>2019-02-27T12:18:03Z</dc:date>
    </item>
  </channel>
</rss>

