<?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 Problem in passing parm to macro need help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44117#M9033</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi HaiKuo, thank you for your help.. Your solution work.. thanks a lot...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Feb 2012 18:01:45 GMT</pubDate>
    <dc:creator>Dennis_Lam</dc:creator>
    <dc:date>2012-02-02T18:01:45Z</dc:date>
    <item>
      <title>Problem in passing parm to macro need help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44115#M9031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I have problem on passing parm to a macro wish someone can give me a hand. Following is the script that I have. I am trying to pass parm to the macro using a do loop but it was not successful. Can anyone give me some advice. thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA rev_data;&lt;BR /&gt;FORMAT rep_month $7. ;&lt;BR /&gt;INPUT @1 rep_month $7.;&lt;BR /&gt;CARDS;&lt;BR /&gt;2012-01&lt;BR /&gt;2012-02&lt;BR /&gt;2012-03&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data rev_data; set rev_data; &lt;BR /&gt;by rep_month;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if first.rep_month then do;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnt = left(put(_n_,6.));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('mth'||cnt, rep_month);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('mthcount', cnt);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;BR /&gt;%put _user_;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;%macro a(m_mth, m_mthcount);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp; %put month = &amp;amp;m_mth. count = &amp;amp;m_mthcount.;&lt;BR /&gt;%mend;&lt;BR /&gt;%a(&amp;amp;mth1, &amp;amp;mthcount);&lt;BR /&gt;data _d_;&lt;BR /&gt;&amp;nbsp; do i = 1 to &amp;amp;mthcount;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; runmth = '&amp;amp;mth'||i;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %a(&amp;amp;mth||i,i);&lt;BR /&gt;&amp;nbsp; end; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 16:31:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44115#M9031</guid>
      <dc:creator>Dennis_Lam</dc:creator>
      <dc:date>2012-02-02T16:31:19Z</dc:date>
    </item>
    <item>
      <title>Problem in passing parm to macro need help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44116#M9032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the last part of your code, I have modified it to macro, hopefully it is what you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro test;&lt;/P&gt;&lt;P&gt;data _d_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %do i = 1 %to &amp;amp;mthcount;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; runmth = "&amp;amp;&amp;amp;mth&amp;amp;i";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %a(&amp;amp;&amp;amp;mth&amp;amp;i,&amp;amp;i);&lt;/P&gt;&lt;P&gt;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc print;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly Regards,&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 16:42:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44116#M9032</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-02-02T16:42:23Z</dc:date>
    </item>
    <item>
      <title>Problem in passing parm to macro need help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44117#M9033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Hi HaiKuo, thank you for your help.. Your solution work.. thanks a lot...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Feb 2012 18:01:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-in-passing-parm-to-macro-need-help/m-p/44117#M9033</guid>
      <dc:creator>Dennis_Lam</dc:creator>
      <dc:date>2012-02-02T18:01:45Z</dc:date>
    </item>
  </channel>
</rss>

