<?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: How to pass a column from a table as a parameter in a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207088#M38494</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set XYZ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('%looper ('||strip(user)||');');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However there are probably better ways of doing it, but without the rest of the information its hard to say.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 May 2015 07:53:52 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-05-01T07:53:52Z</dc:date>
    <item>
      <title>How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207084#M38490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can I pass a table column as a parameter in a macro?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example of what I intend to do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data xyz;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; input userid;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro looper (userid);&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;%mend looper;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 12:24:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207084#M38490</guid>
      <dc:creator>Apprentice</dc:creator>
      <dc:date>2015-04-30T12:24:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207085#M38491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thats exactly the way.&amp;nbsp; Describe further what you problems are, test data/required output is also good.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 12:37:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207085#M38491</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-04-30T12:37:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207086#M38492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to call %LOOPER just once, or do you want to call it for each observation in XYZ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 13:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207086#M38492</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-04-30T13:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207087#M38493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to call % LOOPER for each observation in table XYZ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Apr 2015 21:02:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207087#M38493</guid>
      <dc:creator>Apprentice</dc:creator>
      <dc:date>2015-04-30T21:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207088#M38494</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set XYZ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call execute('%looper ('||strip(user)||');');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However there are probably better ways of doing it, but without the rest of the information its hard to say.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 07:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207088#M38494</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-05-01T07:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207089#M38495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One again I will remind you of the importance of timing with the macro language and the fact that CALL EXECUTE has subtleties that most do NOT understand.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="xis-tipGenText" style="font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-style: italic; font-weight: bold; color: #5d6065; text-indent: -1.5em; background-color: #ffffff;"&gt;T&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #353535; font-family: lato, arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The following example uses the %NRSTR macro quoting function to mask the macro statement. &lt;STRONG&gt;This function will delay the execution of macro statements until after a step boundary.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="xis-codeFragment" style="font-size: 11px; margin: 0 0 0 1.5em; padding-bottom: 8px; font-family: monospace; color: #353535;"&gt;call execute('%nrstr(%sales('||month||'))');&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While it may not matter for the programs that you write we have not seen the OP's program and have no idea what the OP will come up with.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/68140/HTML/default/viewer.htm#n1q1527d51eivsn1ob5hnz0yd1hx.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/68140/HTML/default/viewer.htm#n1q1527d51eivsn1ob5hnz0yd1hx.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 11:27:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207089#M38495</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2015-05-01T11:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207090#M38496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks; this will do it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 13:42:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207090#M38496</guid>
      <dc:creator>Apprentice</dc:creator>
      <dc:date>2015-05-01T13:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass a column from a table as a parameter in a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207091#M38497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be considerate as well to explain why you want to perform such processing, as much as there may be a more effective / efficient technical approach - specifically what is your objective and how might you intend to use the SAS observation content with each macro invocation?&amp;nbsp; It appears that LOOPER is intended to be a code-piece executed within the SAS DATA step you have illustrated, although you have the %MACRO %MEND definition coded after the RUN;&amp;nbsp; statement which will most definitely short-circuit the processing you desire to achieve.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 May 2015 19:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-pass-a-column-from-a-table-as-a-parameter-in-a-macro/m-p/207091#M38497</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-05-01T19:20:25Z</dc:date>
    </item>
  </channel>
</rss>

