<?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: ERROR: Macro keyword DO appears as text in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324512#M62185</link>
    <description>&lt;P&gt;I do have&amp;nbsp;options minoperator; in my code.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2017 10:25:23 GMT</pubDate>
    <dc:creator>GunnerEP</dc:creator>
    <dc:date>2017-01-13T10:25:23Z</dc:date>
    <item>
      <title>ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324474#M62178</link>
      <description>&lt;P&gt;Country used to come in this format - ARG&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if (&amp;amp;&amp;amp;cntry_cd&amp;amp;i = ARG) or %eval(&amp;amp;&amp;amp;cntry_cd&amp;amp;i. IN &amp;amp;list.) %then %do;&lt;BR /&gt;%do a = 0 %to 9;&lt;BR /&gt;%str(execute(DROP TABLE abc PURGE) by hadoop;);&lt;BR /&gt;%end;&lt;BR /&gt;%end;&lt;BR /&gt;%else&lt;BR /&gt;%str(execute(DROP TABLE abcd PURGE) by hadoop;);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;New Country format - 'ARG'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if (%bquote(&amp;amp;qctry. = %str(%')ARG%str(%')) or %eval(%bquote(&amp;amp;qctry.) IN &amp;amp;list.) %then %do;&lt;BR /&gt;%do a = 0 %to 9;&lt;BR /&gt;%str(execute(DROP TABLE abc PURGE) by hadoop;);&lt;BR /&gt;%end;&lt;BR /&gt;%end;&lt;BR /&gt;%else&lt;BR /&gt;%str(execute(DROP TABLE abcd PURGE) by hadoop;);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;ERROR MESSAGE:&lt;/P&gt;&lt;P&gt;ERROR: Macro keyword DO appears as text.&lt;BR /&gt;ERROR: A dummy macro will be compiled.&lt;BR /&gt;ERROR: Macro keyword DO appears as text.&lt;BR /&gt;ERROR: Macro keyword END appears as text.&lt;BR /&gt;ERROR: Macro keyword END appears as text.&lt;BR /&gt;ERROR: There is no matching %IF statement for the %ELSE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not sure why am i getting this error, i am trying to mask the quotes as per the new country format.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 07:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324474#M62178</guid>
      <dc:creator>GunnerEP</dc:creator>
      <dc:date>2017-01-13T07:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324476#M62179</link>
      <description>&lt;P&gt;Can you post the whole macro, or more significant parts of it, and the actual call to the macro as well, please? We need some more context.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 07:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324476#M62179</guid>
      <dc:creator>LaurieF</dc:creator>
      <dc:date>2017-01-13T07:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324482#M62180</link>
      <description>&lt;P&gt;And use the "little running man" icon to post SAS code, as that will prevent the display of colon/closing bracket as a smiley:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;:)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 13 Jan 2017 08:20:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324482#M62180</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-01-13T08:20:31Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324483#M62181</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You seem to have unbalanced parenthesis here:&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;%if &lt;STRONG&gt;(&lt;/STRONG&gt;%bquote(&amp;amp;qctry. = %str(%')ARG%str(%')) or %eval(%bquote(&amp;amp;qctry.) IN &amp;amp;list.) %then %do;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;remove the first one.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;&lt;SPAN&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 08:35:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324483#M62181</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2017-01-13T08:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324486#M62182</link>
      <description>&lt;P&gt;Why are you dropping tables based on some condition. &amp;nbsp;Doesn't that defeat the purpose of audit trails and such like?&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 09:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324486#M62182</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-01-13T09:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324503#M62183</link>
      <description>&lt;P&gt;Thanks for that. but now ran to a different error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. The condition was:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;(%bquote(&amp;amp;qctry. = 'ARG')) or %eval(%bquote(&amp;amp;qctry.) IN &amp;amp;list.)&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 10:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324503#M62183</guid>
      <dc:creator>GunnerEP</dc:creator>
      <dc:date>2017-01-13T10:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324508#M62184</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, that's because you are missing this system option:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;options MINOPERATOR;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;More on this here:&amp;nbsp;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003092012.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a003092012.htm&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 10:20:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324508#M62184</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2017-01-13T10:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324512#M62185</link>
      <description>&lt;P&gt;I do have&amp;nbsp;options minoperator; in my code.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 10:25:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324512#M62185</guid>
      <dc:creator>GunnerEP</dc:creator>
      <dc:date>2017-01-13T10:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324513#M62186</link>
      <description>&lt;P&gt;Then you need to show us what are the values for those macro variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;set:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;options notes mprint &lt;/SPAN&gt;symgen&lt;EM&gt;;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run the code, and show us the log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Daniel Santos&amp;nbsp;@ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 10:29:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324513#M62186</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2017-01-13T10:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324522#M62187</link>
      <description>&lt;P&gt;You should be able to use your original code, even when the form of the incoming data changes. &amp;nbsp;However, you may need to construct &amp;amp;LIST differently. &amp;nbsp;The elements within need to be quoted in order to find a match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if &amp;amp;&amp;amp;CNTRY_CD&amp;amp;I really does resolve to 'ARG', this comparison finds a match:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if (&amp;amp;&amp;amp;cntry_cd&amp;amp;i = 'ARG') then ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You won't need the quoting functions. &amp;nbsp;However, change is needed if &amp;amp;&amp;amp;cntry_cd&amp;amp;i resolves to ARG and not 'ARG'. &amp;nbsp;In that case, the simplest change would be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if (%str(')&amp;amp;&amp;amp;cntry_cd&amp;amp;i%str(') = 'ARG') then ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While that should work, if it doesn't work, you may need to apply:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if (%unquote(%str(')&amp;amp;&amp;amp;cntry_cd&amp;amp;i%str(') = 'ARG') then ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the values you are comparing to have quotes around them, such as 'ARG', the %BQUOTE function will not add those quotes.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 11:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324522#M62187</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-01-13T11:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Macro keyword DO appears as text</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324653#M62197</link>
      <description>&lt;P&gt;You should show the macro definition starting from the %MACRO statement through to the %MEND statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 18:06:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/ERROR-Macro-keyword-DO-appears-as-text/m-p/324653#M62197</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-13T18:06:16Z</dc:date>
    </item>
  </channel>
</rss>

