<?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 condition in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753367#M39068</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311722"&gt;@Rajeshganta&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find out more about the special requirements / limitations of using &lt;FONT face="courier new,courier"&gt;%if&lt;/FONT&gt; in open code then you can read this &lt;A href="https://blogs.sas.com/content/sasdummy/2018/07/05/if-then-else-sas-programs/" target="_blank" rel="noopener"&gt;SAS blog post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Jul 2021 21:39:00 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2021-07-10T21:39:00Z</dc:date>
    <item>
      <title>%if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753068#M39056</link>
      <description>%let &amp;amp;num=101;&lt;BR /&gt;%if %sysfunc(input(&amp;amp;num., Bestx12.)) GE 100 %then %let &amp;amp;email="raj@gma.com";&lt;BR /&gt;Mailer code&lt;BR /&gt;To=(&amp;amp;email.)&lt;BR /&gt;I am using this script but getting the error as %if statement in open code&lt;BR /&gt;Please help me solve the issue</description>
      <pubDate>Fri, 09 Jul 2021 06:28:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753068#M39056</guid>
      <dc:creator>Rajeshganta</dc:creator>
      <dc:date>2021-07-09T06:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: %if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753070#M39057</link>
      <description>&lt;P&gt;If you use %IF in open code (outside a macro), it has to have %DO-%END blocks for the %THEN and %ELSE branches.&lt;/P&gt;
&lt;P&gt;Also note that the "open code %IF" is a fairly recent addition to the SAS system, so you need to have at least 9.4M5, IIRC.&lt;/P&gt;
&lt;P&gt;And also note that you cannot use INPUT in %SYSFUNC, you need to use INPUTN or INPUTC.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 06:44:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753070#M39057</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-09T06:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: %if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753091#M39060</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311722"&gt;@Rajeshganta&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you have fixed the issue causing the error, you will probably also want to look at the &lt;FONT face="courier new,courier"&gt;%let&lt;/FONT&gt; statements, as you don't need an ampersand ("&amp;amp;") before the variable you are &lt;EM&gt;assigning&lt;/EM&gt;, as you have done for num and email, you only need the ampersand in front when you want to use the value that the variable is holding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jul 2021 09:22:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753091#M39060</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2021-07-09T09:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: %if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753123#M39065</link>
      <description>&lt;P&gt;In open code you need %DO/%END blocks.&lt;/P&gt;
&lt;P&gt;You don't need the INPUT() code.&amp;nbsp; The %EVAL() macro function that SAS uses for %IF conditions knows how to perform integer arithmetic.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let num=101;
%if &amp;amp;num GE 100 %then %do;
  %let email="raj@gma.com";
%end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need to perform floating point calculations or use date literals then use %SYSEVALF().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if %sysevalf(&amp;amp;num GE 100) %then %do;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jul 2021 12:24:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753123#M39065</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-07-09T12:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: %if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753159#M39066</link>
      <description>Thank you so much tom, i am able to use the code shared but i need to give else also in this condition that should solve my query for triggering an email only when numver exceed and else it should not execute</description>
      <pubDate>Fri, 09 Jul 2021 14:07:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753159#M39066</guid>
      <dc:creator>Rajeshganta</dc:creator>
      <dc:date>2021-07-09T14:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: %if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753314#M39067</link>
      <description>&lt;P&gt;You expand the %IF with %ELSE:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;lt;condition&amp;gt;
%then %do;
....
%end;
%else %do;
....
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 10 Jul 2021 05:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753314#M39067</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-10T05:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: %if condition</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753367#M39068</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/311722"&gt;@Rajeshganta&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find out more about the special requirements / limitations of using &lt;FONT face="courier new,courier"&gt;%if&lt;/FONT&gt; in open code then you can read this &lt;A href="https://blogs.sas.com/content/sasdummy/2018/07/05/if-then-else-sas-programs/" target="_blank" rel="noopener"&gt;SAS blog post&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jul 2021 21:39:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/if-condition/m-p/753367#M39068</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2021-07-10T21:39:00Z</dc:date>
    </item>
  </channel>
</rss>

