<?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 IF-THEN-ELSE without conditions for THEN in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469620#M120168</link>
    <description>&lt;P&gt;I have this long-running macro code to check for the existence of a local table but there are no statements after the THEN.&amp;nbsp; What happens?&amp;nbsp; What does SAS do?&amp;nbsp; I'm just trying to understand the logic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* make sure the local table exist */&lt;/P&gt;&lt;P&gt;%if %sysfunc(exist(cdm.&amp;amp;tablename)) %then;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let man_month=%sysfunc(putn(%sysfunc(intnx(MONTH,%sysfunc(inputn(&amp;amp;sysdate9,date9.)),+1)),yymmn6.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Jun 2018 13:27:20 GMT</pubDate>
    <dc:creator>Anna_dlC</dc:creator>
    <dc:date>2018-06-12T13:27:20Z</dc:date>
    <item>
      <title>IF-THEN-ELSE without conditions for THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469620#M120168</link>
      <description>&lt;P&gt;I have this long-running macro code to check for the existence of a local table but there are no statements after the THEN.&amp;nbsp; What happens?&amp;nbsp; What does SAS do?&amp;nbsp; I'm just trying to understand the logic&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* make sure the local table exist */&lt;/P&gt;&lt;P&gt;%if %sysfunc(exist(cdm.&amp;amp;tablename)) %then;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %let man_month=%sysfunc(putn(%sysfunc(intnx(MONTH,%sysfunc(inputn(&amp;amp;sysdate9,date9.)),+1)),yymmn6.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %return;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 13:27:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469620#M120168</guid>
      <dc:creator>Anna_dlC</dc:creator>
      <dc:date>2018-06-12T13:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN-ELSE without conditions for THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469624#M120169</link>
      <description>&lt;P&gt;If this macro finds that the table exists, it does nothing. If it does not exists then it does the calculation in the %ELSE portion.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 13:34:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469624#M120169</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-06-12T13:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: IF-THEN-ELSE without conditions for THEN</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469626#M120171</link>
      <description>&lt;P&gt;A more readable version would be to simply negate the condition :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if not %sysfunc(exist(cdm.&amp;amp;tablename)) %then do;  
    %let man_month=....
%end;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 13:46:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IF-THEN-ELSE-without-conditions-for-THEN/m-p/469626#M120171</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2018-06-12T13:46:16Z</dc:date>
    </item>
  </channel>
</rss>

