<?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: if  else question in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262808#M57692</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a=1
then do;
  if b=2
  then k=1;
  else if b=20
  then k=2;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is equivalent to yor need2 condition.&lt;/P&gt;</description>
    <pubDate>Mon, 11 Apr 2016 06:11:45 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2016-04-11T06:11:45Z</dc:date>
    <item>
      <title>if  else question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262762#M57690</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;
&lt;P&gt;need 1 not works but simple,I want the result as need2, but can't I omiss 'a=1' in need 2?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;a=1;b=2;c=3; output;&lt;BR /&gt;a=100;b=20;c=30;output;&lt;BR /&gt;a=1;b=20;c=30;output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data need1;&lt;BR /&gt;k=0;&lt;BR /&gt;set have;&lt;BR /&gt;if a=1 and b=2 then k=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if b=20 then k=2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;data need2;&lt;BR /&gt;k=0;&lt;BR /&gt;set have;&lt;BR /&gt;if a=1 and b=2 then k=1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if &lt;STRONG&gt;&lt;U&gt;a=1 and&lt;/U&gt;&lt;/STRONG&gt; b=20 then k=2;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 01:25:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262762#M57690</guid>
      <dc:creator>GeorgeSAS</dc:creator>
      <dc:date>2016-04-11T01:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: if  else question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262767#M57691</link>
      <description>&lt;P&gt;Are you trying to create a counter by a variable?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your logic is hardcoded, you need to generalize your logic so that it will work in more situations.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 02:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262767#M57691</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-04-11T02:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: if  else question</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262808#M57692</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a=1
then do;
  if b=2
  then k=1;
  else if b=20
  then k=2;
end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is equivalent to yor need2 condition.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Apr 2016 06:11:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/if-else-question/m-p/262808#M57692</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-04-11T06:11:45Z</dc:date>
    </item>
  </channel>
</rss>

