<?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: use macro in if-else statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447330#M112352</link>
    <description>&lt;P&gt;My preference is to just let it stand as is.&amp;nbsp; I say that because the question has changed somewhat.&amp;nbsp; One of my pet peeves is questions that morph as they are solved, and I would much rather avoid that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"OK, that worked but what I really need is to ..."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"OK, that worked.&amp;nbsp; The next step is to ..."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let this part stand as a separate question, and chips fall where they may.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Mar 2018 04:51:49 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-03-21T04:51:49Z</dc:date>
    <item>
      <title>use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447316#M112342</link>
      <description>&lt;P&gt;when I merely used macro:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%extracTable();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there is no error..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however when I am using :&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;if 1=1&lt;/P&gt;&lt;P&gt;then %extracTable();&lt;/P&gt;&lt;P&gt;else put @@@do not insert@@@;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it return :&lt;/P&gt;&lt;P&gt;error:unquote array:Execute&lt;/P&gt;&lt;P&gt;error:388-105&lt;/P&gt;&lt;P&gt;error 76-322&lt;/P&gt;&lt;P&gt;error:180-322&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why and how to fix it...I am weak at sas Marco grammar..thank you&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447316#M112342</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-03-21T04:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447320#M112345</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if 1=1 then call execute('%extracTable();');&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:25:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447320#M112345</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-21T04:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447322#M112346</link>
      <description>&lt;P&gt;I'm not sure I should reply.&amp;nbsp; You seem unwilling or perhaps unable to take my advice on other questions.&amp;nbsp; So last attempt:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;if 1=1&lt;/P&gt;
&lt;P&gt;then call execute('%nrstr&lt;FONT color="#FF0000"&gt;(&lt;/FONT&gt;%extracTable()&lt;FONT color="#FF0000"&gt;)&lt;/FONT&gt;');&lt;/P&gt;
&lt;P&gt;else put '@@@do not insert@@@';&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not clear why you need an ELSE condition when 1=1 must always be true, but perhaps this is a simplification of a more complex problem.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:32:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447322#M112346</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-21T04:32:29Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447325#M112348</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;I didn't see this thread was the continuation of &lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/ERROR-117-185-There-was-1-unclosed-DO-block/m-p/447303#M112330" target="_self"&gt;another thread&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Maybe should it&amp;nbsp;be marked as spam to remove duplicates?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:41:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447325#M112348</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-03-21T04:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447326#M112349</link>
      <description>thanks..I get the result right,but still an error :&lt;BR /&gt;ERROR 180-322:statement is not valid.&lt;BR /&gt;why and how to do..</description>
      <pubDate>Wed, 21 Mar 2018 04:45:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447326#M112349</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-03-21T04:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447328#M112350</link>
      <description>thanks in advance..I get the result right,but still an error :&lt;BR /&gt;ERROR 180-322:statement is not valid.&lt;BR /&gt;why and how to do..</description>
      <pubDate>Wed, 21 Mar 2018 04:46:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447328#M112350</guid>
      <dc:creator>Geo-</dc:creator>
      <dc:date>2018-03-21T04:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447330#M112352</link>
      <description>&lt;P&gt;My preference is to just let it stand as is.&amp;nbsp; I say that because the question has changed somewhat.&amp;nbsp; One of my pet peeves is questions that morph as they are solved, and I would much rather avoid that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"OK, that worked but what I really need is to ..."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"OK, that worked.&amp;nbsp; The next step is to ..."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let this part stand as a separate question, and chips fall where they may.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447330#M112352</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-21T04:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447331#M112353</link>
      <description>&lt;P&gt;For someone to diagnose the error, you will need to post the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 04:54:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447331#M112353</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-21T04:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: use macro in if-else statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447449#M112407</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;For someone to diagnose the error, you will need to post the log.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;And perhaps the actual macro code that is called.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And run the code with: Options mprint symbolgen mlogic;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then post the log with the code and error messages into a code box opened&amp;nbsp;using the forum {I} menu icon. Error messages often have indicators of position where SAS identified the error but the main message windows of this forum will reformat text resulting in moved indicators. The code box will preserve text as copied from the log so the diagnostics are in the correct position.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that errors caused by macro code do not display in the most helpful manner unless the MPRINT option is set.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 15:34:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/use-macro-in-if-else-statement/m-p/447449#M112407</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-03-21T15:34:54Z</dc:date>
    </item>
  </channel>
</rss>

