<?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: Simple macro but doesn't work in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495771#M130924</link>
    <description>&lt;LI-CODE lang="sas"&gt;ODs output ....; proc genmod data=have; &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;By date_of_diagnosis_yyyy;&lt;/STRONG&gt;&lt;/FONT&gt; class zone(ref="0") sex(ref="1") racecat(ref="1") agecat(ref="2")/param=ref; model n_cases_reg=zone sex racecat agecat zone|date_of_diagnosis_yyyy/ dist=negbin link=log offset=ln type3; ods trace on; &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;where zone ne '9';&lt;/STRONG&gt;&lt;/FONT&gt; run; &lt;/LI-CODE&gt;
&lt;P&gt;Any reason you can’t run this as above?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2018 17:14:31 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-09-14T17:14:31Z</dc:date>
    <item>
      <title>Simple macro but doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495739#M130904</link>
      <description>&lt;P&gt;I'm trying to repeat the code below 20 times for 20 consequent years. The macro doesn't help. The problem&amp;nbsp;I think is&lt;/P&gt;
&lt;P&gt;in the "date_of_diagnosis_yyyy='n' " .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help in the code, if you have time. Any idea why this approach doesn't work?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro models(param,par,n);&lt;BR /&gt;&lt;BR /&gt;ods output parameterestimates=&amp;amp;param;
proc genmod data=have;
class zone(ref="0") sex(ref="1") racecat(ref="1") agecat(ref="2")/param=ref;
model n_cases_reg=zone sex racecat agecat
      zone|date_of_diagnosis_yyyy/ dist=negbin link=log offset=ln type3;
ods trace on;
where zone ne '9' and date_of_diagnosis_yyyy eq 'n';
run;  

ods rtf close;
data &amp;amp;par; set &amp;amp;param;
if pam~ in ("Scale","Intercept") then do;
RR= exp(estimate);
low_rr=exp(estimate-(1.96*stderr));
up_rr=exp(estimate+(1.96*stderr));
end;
run;

%mend models;
%models(param1995,par1995,1995);
.
so forth so on until
.
%models(param2015,par2015,2015);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 15:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495739#M130904</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-09-14T15:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: Simple macro but doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495753#M130913</link>
      <description>&lt;P&gt;The problem does not lie within the macro.&amp;nbsp; The problem lies with the fact that the macro exists at all.&amp;nbsp; If you want a separate analysis for each year, sort your data by year and run GENMOD by year.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 16:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495753#M130913</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-09-14T16:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Simple macro but doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495755#M130915</link>
      <description>Your parameters are macro variables. Remember they only resolve in double quotes and need an ampersand. The line you indicated does neither.&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Sep 2018 16:32:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495755#M130915</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-14T16:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simple macro but doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495758#M130917</link>
      <description>I don't quite get it Astounding.</description>
      <pubDate>Fri, 14 Sep 2018 16:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495758#M130917</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2018-09-14T16:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Simple macro but doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495770#M130923</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt; date_of_diagnosis_yyyy &lt;SPAN class="token operator"&gt;eq&lt;/SPAN&gt; “&amp;amp;n”&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Sep 2018 17:11:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495770#M130923</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-14T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple macro but doesn't work</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495771#M130924</link>
      <description>&lt;LI-CODE lang="sas"&gt;ODs output ....; proc genmod data=have; &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;By date_of_diagnosis_yyyy;&lt;/STRONG&gt;&lt;/FONT&gt; class zone(ref="0") sex(ref="1") racecat(ref="1") agecat(ref="2")/param=ref; model n_cases_reg=zone sex racecat agecat zone|date_of_diagnosis_yyyy/ dist=negbin link=log offset=ln type3; ods trace on; &lt;FONT size="5" color="#FF0000"&gt;&lt;STRONG&gt;where zone ne '9';&lt;/STRONG&gt;&lt;/FONT&gt; run; &lt;/LI-CODE&gt;
&lt;P&gt;Any reason you can’t run this as above?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 17:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simple-macro-but-doesn-t-work/m-p/495771#M130924</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-09-14T17:14:31Z</dc:date>
    </item>
  </channel>
</rss>

