<?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: stored macro execution inside a macro called with CALL EXECUTE routine in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116989#M24165</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably need to delay execution of the CALL EXECUTEd macro until after the data step that is doing the CALL EXECUTEing finishes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call execute('%nrstr(%germvars('....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: data _null_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 24 Jun 2013 13:19:04 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2013-06-24T13:19:04Z</dc:date>
    <item>
      <title>stored macro execution inside a macro called with CALL EXECUTE routine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116986#M24162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Somebody knows why %missvars works fine in a normal program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %missvars(ds); /* &lt;A href="http://www.datasavantconsulting.com/roland/missvars.sas" title="http://www.datasavantconsulting.com/roland/missvars.sas"&gt;http://www.datasavantconsulting.com/roland/missvars.sas&lt;/A&gt; */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and doesn't in a macro called with call execute routine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %macro test;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %missvars(ds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend test;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set NRC_germ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('%test('||trim(Germ)||')');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 12:12:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116986#M24162</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2013-06-24T12:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: stored macro execution inside a macro called with CALL EXECUTE routine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116987#M24163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't have argument in your macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test(ds);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %missvars(&amp;amp;ds)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %mend test;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 12:20:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116987#M24163</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-06-24T12:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: stored macro execution inside a macro called with CALL EXECUTE routine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116988#M24164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right,&lt;/P&gt;&lt;P&gt;but this is just a simplified code I wrote quickly. No repercussions here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the actual code if you need it (but it'll confuse the question)&lt;/P&gt;&lt;P&gt;(I'am trying to change %missvars with %dropmiss right now but it's the same issue : it produces weird logs with no errors (cf. attached log) ) :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13720788268744716" jivemacro_uid="_13720788268744716"&gt;
&lt;P&gt;data NRC_GERMVARIABLE(where=(Germ ne ""));&lt;/P&gt;
&lt;P&gt;&amp;nbsp; length Source Germ Variable $30;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;%macro germvars(subject);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put 0--- subject=&amp;amp;subject;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put 1--- select germ ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; data WORK.NRC_VARIABLES1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set ID_DATA.NRC_CLEAN;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; where Subject="&amp;amp;subject";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put 2--- remove empty variables ;&lt;/P&gt;
&lt;P&gt;/* %missvars(NRC_VARIABLES1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put &amp;amp;_miss_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; data NRC_VARIABLES2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set NRC_VARIABLES1(drop=&amp;amp;_miss_);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;*/&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %dropmiss(NRC_VARIABLES1,NRC_VARIABLES2);&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put 3--- list variables vertically ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; proc transpose&lt;/P&gt;
&lt;P&gt;&amp;nbsp; data= WORK.NRC_VARIABLES2 (obs=1)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; out= WORK.NRC_VARIABLES3(rename=(_NAME_=Variable) drop=_LABEL_);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; var _all_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %put 4--- append them in NRC_GERMVARIABLE ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; data&amp;nbsp; WORK.NRC_VARIABLES4 (drop=col1);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; length col1 $20;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set&amp;nbsp; WORK.NRC_VARIABLES3;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; col1=col1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Source="NRC";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Germ="&amp;amp;subject";&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; PROC APPEND BASE=NRC_GERMVARIABLE DATA= WORK.NRC_VARIABLES4 FORCE NOWARN;&lt;/P&gt;
&lt;P&gt;/* */&lt;/P&gt;
&lt;P&gt;%mend germvars;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; set NRC_germ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; call execute('%germvars('||trim(Germ)||')');&lt;/P&gt;
&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;(this forum still needs sas syntaxing)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from the log it looks like de the order of execution is not right.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 13:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116988#M24164</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2013-06-24T13:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: stored macro execution inside a macro called with CALL EXECUTE routine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116989#M24165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably need to delay execution of the CALL EXECUTEd macro until after the data step that is doing the CALL EXECUTEing finishes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call execute('%nrstr(%germvars('....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: data _null_&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 13:19:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116989#M24165</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2013-06-24T13:19:04Z</dc:date>
    </item>
    <item>
      <title>Re: stored macro execution inside a macro called with CALL EXECUTE routine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116990#M24166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;CALL EXECUTE is tricky.&amp;nbsp; The standard actions it takes are to perform any macro language statements immediately.&amp;nbsp; However, any generated DATA and PROC statements have to wait until the currently executing DATA step completes.&amp;nbsp; So all your %PUT statements execute right away, before the generated DATA and PROC steps have run.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code is probably breaking down at the point this statement appears:&amp;nbsp; %put &amp;amp;_miss_;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We don't see the definition of the interior macros, but it is fairly certain that this %PUT statement executes before &amp;amp;_miss_ has been created.&amp;nbsp; Without seeing the macros nor the error messages, it's a little difficult to say.&amp;nbsp; But it seems likely that this is the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The usual remedy to delay macro execution when using CALL EXECUTE is to apply the %NRSTR function within the CALL EXECUTE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 13:21:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116990#M24166</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-06-24T13:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: stored macro execution inside a macro called with CALL EXECUTE routine</title>
      <link>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116991#M24167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's it, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%NRSTR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Thanks !&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Jun 2013 13:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/stored-macro-execution-inside-a-macro-called-with-CALL-EXECUTE/m-p/116991#M24167</guid>
      <dc:creator>mathias</dc:creator>
      <dc:date>2013-06-24T13:36:49Z</dc:date>
    </item>
  </channel>
</rss>

