<?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 HELP in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78395#M3743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before going all the way to a macro try replacing the parts that change with a macro variable reference.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let ds=test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let var=age;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods pdf file="C:\Data\Projects\Dhoom-20120911002\&lt;STRONG&gt;&amp;amp;var.&lt;/STRONG&gt;.pdf";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc freq data=&lt;STRONG&gt;&amp;amp;ds&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;tables &lt;STRONG&gt;&amp;amp;var&lt;/STRONG&gt;*Pat/nopercent fisher relrisk;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;exact pchi or;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;title "&lt;STRONG&gt;&amp;amp;var&lt;/STRONG&gt; vs Pat";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Then you can try calling it a couple times changing the value of the macro variables VAR and DS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Once you have it working you can wrap it in a macro;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro report1(ds,var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods pdf file=........&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend report1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Then you can call it 11 times by just writing 11 macro calls with different values for the parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%report1(test,age)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%report1(test,ht)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 26 Sep 2012 21:24:20 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-09-26T21:24:20Z</dc:date>
    <item>
      <title>MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78394#M3742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;STRONG&gt;Could you help me build a macro please...&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ods pdf file&lt;/STRONG&gt;="C:\Data\Projects\Dhoom-20120911002\age.pdf";&lt;BR /&gt;proc freq data=test;&lt;BR /&gt;tables age*Pat/nopercent fisher&amp;nbsp; relrisk; &lt;BR /&gt;exact pchi or;&lt;BR /&gt;title "Age vs Pat";&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; &lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=test;&lt;BR /&gt;tables age*Comp/nopercent fisher&amp;nbsp; relrisk;&lt;BR /&gt;exact pchi or;&lt;BR /&gt;title "Age vs Comp";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=test;&lt;BR /&gt;tables age*Any/nopercent fisher&amp;nbsp; relrisk;&lt;BR /&gt;exact pchi or;&lt;BR /&gt;title "Age vs Any";&lt;BR /&gt;run;&lt;BR /&gt;&lt;STRONG&gt;ods pdf close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This piece of code repeats for 11 variables.&lt;/P&gt;&lt;P&gt;in the ods statement the name of the pdf changes next time&lt;BR /&gt;tables statement age changs to another next &lt;BR /&gt;title for the above next time :Age is replaced with another&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 20:51:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78394#M3742</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-26T20:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78395#M3743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Before going all the way to a macro try replacing the parts that change with a macro variable reference.&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let ds=test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let var=age;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods pdf file="C:\Data\Projects\Dhoom-20120911002\&lt;STRONG&gt;&amp;amp;var.&lt;/STRONG&gt;.pdf";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc freq data=&lt;STRONG&gt;&amp;amp;ds&lt;/STRONG&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;tables &lt;STRONG&gt;&amp;amp;var&lt;/STRONG&gt;*Pat/nopercent fisher relrisk;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;exact pchi or;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;title "&lt;STRONG&gt;&amp;amp;var&lt;/STRONG&gt; vs Pat";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Then you can try calling it a couple times changing the value of the macro variables VAR and DS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Once you have it working you can wrap it in a macro;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%macro report1(ds,var);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods pdf file=........&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;....&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%mend report1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;Then you can call it 11 times by just writing 11 macro calls with different values for the parameters.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%report1(test,age)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%report1(test,ht)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78395#M3743</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-09-26T21:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78396#M3744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;The three freqs shown above&lt;STRONG&gt; constitutes a block.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to compute &lt;STRONG&gt;11 blocks like that.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I think u misunderstood the 3 freqs shown above for 3 blocks.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:36:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78396#M3744</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-26T21:36:28Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78397#M3745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No. I just didn't want to retype the whole thing. Hence the use of ellipses (...) in my sample code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78397#M3745</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-09-26T21:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78398#M3746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok Got u.&lt;/P&gt;&lt;P&gt;But in the second block also the dset name is the same. So i can keep it intact right instead of assigning it a macro variable reference???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thnx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78398#M3746</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-26T21:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78399#M3747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why write your own?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do some googling to get the code and then dissect it instead with some put statements. Unless you're doing it as a learning exercise instead of work....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's an example of one that I've used before and like, the summary one. And if its not what you want, at least you have an idea of how to create the macro and where to start instead of scratch.&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://mayoresearch.mayo.edu/mayo/research/biostat/sasmacros.cfm" title="http://mayoresearch.mayo.edu/mayo/research/biostat/sasmacros.cfm"&gt;http://mayoresearch.mayo.edu/mayo/research/biostat/sasmacros.cfm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:55:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78399#M3747</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-09-26T21:55:08Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78400#M3748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes.&amp;nbsp; I just did that to show that you are not limited to a single parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:56:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78400#M3748</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-09-26T21:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: MACRO HELP</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78401#M3749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reeza&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Sep 2012 21:59:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/MACRO-HELP/m-p/78401#M3749</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2012-09-26T21:59:12Z</dc:date>
    </item>
  </channel>
</rss>

