<?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: macro parameter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203503#M37920</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But then why bother with the macro at all:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt;proc print data=sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC12" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where age='||strip(put(age,best.))||' and sex="'||strip(sex)|||'";&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC13" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;');&lt;/P&gt;&lt;P class="line" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jul 2015 14:47:58 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-07-15T14:47:58Z</dc:date>
    <item>
      <title>macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203501#M37918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a sas table which contains paths from my computer. how can I use the table column as parameter for a macro which I need to run for every path?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:26:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203501#M37918</guid>
      <dc:creator>googa22</dc:creator>
      <dc:date>2015-07-15T14:26:15Z</dc:date>
    </item>
    <item>
      <title>Re: macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203502#M37919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Call execute&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC1"&gt;/********************************************************************&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC2"&gt;Example : Call macro using parameters from data set&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC3"&gt;********************************************************************/&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC4"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC5"&gt;proc sort data=sashelp.class out=class;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC6"&gt;by age sex;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC7"&gt;run;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC8"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC9"&gt;%macro summary(age=, sex=);&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC10"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC11"&gt;proc print data=sashelp.class;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC12"&gt;where age=&amp;amp;age and sex="&amp;amp;sex";&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC13"&gt;run;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC14"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC15"&gt;%mend;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC16"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC17"&gt;data sample;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC18"&gt;set class;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC19"&gt;by age sex;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC20"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC21"&gt;if last.sex;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC22"&gt;string =&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC23"&gt;&amp;nbsp; catt('%summary(age=', age, ',sex=', sex, ');');&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC24"&gt;put string;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC25"&gt;run;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC26"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC27"&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC28"&gt;data _null_;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC29"&gt;set sample;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC30"&gt;call execute(string);&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC31"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:34:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203502#M37919</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-15T14:34:27Z</dc:date>
    </item>
    <item>
      <title>Re: macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203503#M37920</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But then why bother with the macro at all:&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; line-height: 1.5em; background-color: #ffffff;"&gt;proc print data=sashelp.class;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC12" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; where age='||strip(put(age,best.))||' and sex="'||strip(sex)|||'";&lt;/P&gt;&lt;P class="line" id="file-sas_call_execute-LC13" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;');&lt;/P&gt;&lt;P class="line" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203503#M37920</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-15T14:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203504#M37921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is a stock example for call execute and passing parameters, I would assume that the actual macro the OP is calling is more complicated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:59:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203504#M37921</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-07-15T14:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203505#M37922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;this page contains a macro which reads a data set and calls another macro&lt;/P&gt;&lt;P&gt;using values in each row as parameters for the called macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/Macro_CallMacr" title="http://www.sascommunity.org/wiki/Macro_CallMacr"&gt;http://www.sascommunity.org/wiki/Macro_CallMacr&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 20:54:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203505#M37922</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2015-07-15T20:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203506#M37923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;beware of using call execute to generate a macro call without enclosing the macro call in %nrstr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call execute(catt('%nrstr(%MyMacro(data=',data,',var=',var&lt;/P&gt;&lt;P&gt;,'))'&lt;/P&gt;&lt;P&gt;));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(did I count and quote all the parentheses correctly?)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why: this will save your soul when you get around to using this trick&lt;/P&gt;&lt;P&gt;to call a macro which contains complexity: %if %do or symput.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jul 2015 21:01:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203506#M37923</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2015-07-15T21:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: macro parameter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203507#M37924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, that is actually to do with the order of the compilation phase.&amp;nbsp; If you call execute a macro with a call symput in, then it only affects the first occurence.&amp;nbsp;&amp;nbsp; So if you doing that multiple times in a macro then it will work, but will only contain the first value.&amp;nbsp; Generally I avoid using macro and call execute, mainly because pretty much anything I do in macro can be done in call execute or vice versa. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jul 2015 07:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-parameter/m-p/203507#M37924</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-16T07:50:37Z</dc:date>
    </item>
  </channel>
</rss>

