<?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 then else if statement not working in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357814#M23558</link>
    <description>&lt;P&gt;You need a slightly different syntax with multiple "then" results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if MSG_ID = 'NO MSG' then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;RELATIONSHIP_ID = GLOBL_CUST_ID ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;RELATIONSHIP_NAME = CUS_NAME;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;else ...&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2017 10:37:26 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-05-11T10:37:26Z</dc:date>
    <item>
      <title>If then else if statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357812#M23557</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WHATS WRONG WITH THIS IF THEN ELSE STaTEMENT ? It keeps throwing error&lt;/P&gt;&lt;P&gt;Data work.XX1;&lt;/P&gt;&lt;P&gt;26&lt;/P&gt;&lt;P&gt;27 set work.XX;&lt;/P&gt;&lt;P&gt;28&lt;/P&gt;&lt;P&gt;29 where INTRA_IND = 'N' ;&lt;/P&gt;&lt;P&gt;30&lt;/P&gt;&lt;P&gt;31 if MSG_ID = 'NO MSG'&lt;/P&gt;&lt;P&gt;32&lt;/P&gt;&lt;P&gt;33 then&lt;/P&gt;&lt;P&gt;34&lt;/P&gt;&lt;P&gt;35 RELATIONSHIP_ID = GLOBL_CUST_ID ;&lt;/P&gt;&lt;P&gt;36&lt;/P&gt;&lt;P&gt;37 RELATIONSHIP_NAME = CUS_NAME;&lt;/P&gt;&lt;P&gt;38&lt;/P&gt;&lt;P&gt;39 else&lt;/P&gt;&lt;P&gt;____&lt;/P&gt;&lt;P&gt;160&lt;/P&gt;&lt;P&gt;2 The SAS System 10:23 Thursday, May 11, 2017&lt;/P&gt;&lt;P&gt;ERROR 160-185: No matching IF-THEN clause.&lt;/P&gt;&lt;P&gt;40&lt;/P&gt;&lt;P&gt;41 RELATIONSHIP_ID = MSG_ID;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 10:30:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357812#M23557</guid>
      <dc:creator>Deepti_virmani</dc:creator>
      <dc:date>2017-05-11T10:30:47Z</dc:date>
    </item>
    <item>
      <title>Re: If then else if statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357814#M23558</link>
      <description>&lt;P&gt;You need a slightly different syntax with multiple "then" results:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if MSG_ID = 'NO MSG' then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;RELATIONSHIP_ID = GLOBL_CUST_ID ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;RELATIONSHIP_NAME = CUS_NAME;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;else ...&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2017 10:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357814#M23558</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-05-11T10:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: If then else if statement not working</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357815#M23559</link>
      <description>&lt;P&gt;Its not syntactically correct, if/then else can only have one command between then and else, and no ;. &amp;nbsp;To do block of code between then and else you use do; and end;, per:&lt;/P&gt;
&lt;PRE&gt;data work.xx1;
  set work.xx;
  where intra_ind='N';
  if msg_id='NO MSG' then do;
    relationship_id=globl_cust_id;
    relationship_name=cus_name;
  end;
  else do;
    ...
  end;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 11 May 2017 10:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/If-then-else-if-statement-not-working/m-p/357815#M23559</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-11T10:37:46Z</dc:date>
    </item>
  </channel>
</rss>

