<?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: Macros Help in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558133#M10083</link>
    <description>&lt;P&gt;Looks like you are using SAS/Connect to remote submit some code to another SAS session?&lt;/P&gt;
&lt;P&gt;Looks like your program has gotten confused about what code is being sent to which session and so you have gotten code like %GOTO and %DO/%END that can only work inside of a macro definition pushed into open code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 12 May 2019 15:27:26 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-05-12T15:27:26Z</dc:date>
    <item>
      <title>Macros Help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558111#M10079</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%end;
);
%end;

/* Macro jumps here if it has already been run with these parameters. */

%The_End:
%if &amp;amp;rflag=YES %then
%do;
NOTE: Remote submit to SASSRVP complete.
MLOGIC(RSUBMIT):  Ending execution.
ERROR: The %END statement is not valid in open code.

MPRINT(GRAB_INSTALL_DATA):   proc sql;
SYMBOLGEN:  Macro variable INCLUDE_XICMS resolves to Y
MLOGIC(GRAB_INSTALL_DATA):  %IF condition &amp;amp;include_xicms.=N is FALSE
SYMBOLGEN:  Macro variable ST_DAT resolves to &amp;amp;be_date.
WARNING: Apparent symbolic reference BE_DATE not resolved.
WARNING: Apparent symbolic reference BE_DATE not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric
       operand is required. The condition was: &amp;amp;be_date.
SYMBOLGEN:  Macro variable END_DAT resolves to &amp;amp;en_date.
WARNING: Apparent symbolic reference EN_DATE not resolved.
WARNING: Apparent symbolic reference EN_DATE not resolved.
ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric
       operand is required. The condition was: &amp;amp;en_date.
MLOGIC(GRAB_INSTALL_DATA):  %IF condition %sysevalf(&amp;amp;st_dat) &amp;lt;
      %sysfunc(intnx(Month,%sysfunc(today()),0)) and   %sysevalf(&amp;amp;end_dat) &amp;gt;=
      %sysevalf('01jan2008'd) is FALSE
ERROR: The macro GRAB_INSTALL_DATA will stop executing.
MPRINT(GRAB_INSTALL_DATA):   create table allfails as select * from
staging.ads_daily_failed_installs where scheduled_date ge intnx('month',today(),0) and SITEID
ne 34 and type in ('A','D','T','H','V','U','F','4','#','-','2')
MLOGIC(GRAB_INSTALL_DATA):  Ending execution.&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 May 2019 06:48:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558111#M10079</guid>
      <dc:creator>saikiran_nemani</dc:creator>
      <dc:date>2019-05-12T06:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: Macros Help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558121#M10081</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;&lt;SPAN class="token macroname"&gt;%The_End&lt;/SPAN&gt;:
&lt;SPAN class="token macrostatement"&gt;%if&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;rflag&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;YES &lt;SPAN class="token macrostatement"&gt;%then&lt;/SPAN&gt;
&lt;SPAN class="token macrostatement"&gt;%do&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;NOTE&lt;/SPAN&gt;: Remote submit to SASSRVP complete&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;
MLOGIC&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token statement"&gt;RSUBMIT&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;:  Ending &lt;SPAN class="token number"&gt;ex&lt;/SPAN&gt;ecution&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;
ERROR: The &lt;SPAN class="token macrostatement"&gt;%END&lt;/SPAN&gt; statement is &lt;SPAN class="token operator"&gt;not&lt;/SPAN&gt; valid &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;open&lt;/SPAN&gt; code&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This error happens because you are using %IF %THEN %DO outside of a macro. You can't do that (unless your have SAS 9.4TS1M5 or later, which obviously you don't).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;SYMBOLGEN:  &lt;SPAN class="token procnames"&gt;Macro&lt;/SPAN&gt; variable ST_DAT resolves to &lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;be_date&lt;SPAN class="token punctuation"&gt;.&lt;BR /&gt;&lt;/SPAN&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;WARNING: Apparent symbolic reference BE_DATE &lt;SPAN class="token operator"&gt;not&lt;/SPAN&gt; resolved&lt;SPAN class="token punctuation"&gt;.&lt;/SPAN&gt;&lt;/CODE&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You macro variable ST_DAT is replaced by the text &amp;amp;be_date, a macro variable which does not have a value, so your SAS program does not know how to continue.&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 11:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558121#M10081</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-12T11:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Macros Help</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558133#M10083</link>
      <description>&lt;P&gt;Looks like you are using SAS/Connect to remote submit some code to another SAS session?&lt;/P&gt;
&lt;P&gt;Looks like your program has gotten confused about what code is being sent to which session and so you have gotten code like %GOTO and %DO/%END that can only work inside of a macro definition pushed into open code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 May 2019 15:27:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Macros-Help/m-p/558133#M10083</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-05-12T15:27:26Z</dc:date>
    </item>
  </channel>
</rss>

