<?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: Looping with a macro variable in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205547#M11053</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data reshape will take care of that. The last instance of &amp;amp;var becomes unnecessary.&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="10634" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data flipped;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array event(20) event1-event20;&lt;/P&gt;&lt;P&gt;array factor(20) factor1-factor20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do group=1 to 20;&lt;/P&gt;&lt;P&gt;event_group=event(i);&lt;/P&gt;&lt;P&gt;factor_group=factor(i);&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s2" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;phreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;data&lt;/SPAN&gt;=flipped;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by group;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;strata&lt;/SPAN&gt; country;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;class&lt;/SPAN&gt; sex ;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;model&lt;/SPAN&gt; time*event&lt;STRONG style="text-decoration: underline;"&gt;_group&lt;/STRONG&gt;=factor&lt;STRONG style="text-decoration: underline;"&gt;_group&lt;/STRONG&gt; age weight / &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;rl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;output&lt;/SPAN&gt; parameterestimates = CorrelationEstimate;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Jun 2015 16:55:20 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-06-15T16:55:20Z</dc:date>
    <item>
      <title>Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205542#M11048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;I have a code that looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;%let&lt;/SPAN&gt; var=1;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;&lt;STRONG&gt;phreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;data&lt;/SPAN&gt;=have ;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;strata&lt;/SPAN&gt; country;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;class&lt;/SPAN&gt; sex ;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;model&lt;/SPAN&gt; time*event&amp;amp;var(&lt;SPAN class="s3"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;)=factor&amp;amp;var age weight / &lt;SPAN class="s1"&gt;rl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;output&lt;/SPAN&gt; parameterestimates = CorrelationEstimate&amp;amp;var;&lt;/P&gt;&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;The reason why I am using a macro variable is that I need to repeat this code 20 times, with the "var" value from 1 to 20.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;I have been doing this manually by changing the number and re-running the code. There should however be a way to "loop" through numbers 1 to 20 and re-run the code automatically&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;Any tips? &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;Appreciated&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2"&gt;&lt;SPAN class="s4"&gt;Best reg&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2015 22:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205542#M11048</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-13T22:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205543#M11049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use a %do loop, but it needs to be within a macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%macro repeat_phreg(ntimes=);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%do var=1 %to &amp;amp;ntimes;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p1" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s2" style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2" style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;phreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;data&lt;/SPAN&gt;=have ;&lt;/P&gt;&lt;P class="p1" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;strata&lt;/SPAN&gt; country;&lt;/P&gt;&lt;P class="p1" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;class&lt;/SPAN&gt; sex ;&lt;/P&gt;&lt;P class="p1" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;model&lt;/SPAN&gt; time*event&amp;amp;var(&lt;SPAN class="s3" style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;)=factor&amp;amp;var age weight / &lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;rl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-style: inherit; font-family: inherit;"&gt;output&lt;/SPAN&gt; parameterestimates = CorrelationEstimate&amp;amp;var;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;%end;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;%mend;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG&gt;%repeat_phreg(ntimes=20);&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;SPAN class="s4" style="font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2015 22:49:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205543#M11049</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-13T22:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205544#M11050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Reza, much appreciated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Jun 2015 23:02:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205544#M11050</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-13T23:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205545#M11051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="http://blogs.sas.com/content/iml/2011/01/31/reshaping-data-from-wide-to-long-format.html"&gt;Convert the data from wide to long format.&lt;/A&gt; The data then has 20 BY groups with values 1-20, and a single variable (call it FACTOR) that represents the stacking of factor1-factor20.&amp;nbsp; Then run a single analysis. It will be much easier to compare the results, which are now in a single data set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2"&gt;&lt;STRONG&gt;phreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;data&lt;/SPAN&gt;=have ;&lt;/P&gt;&lt;P class="p1"&gt;by group;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;strata&lt;/SPAN&gt; country;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;class&lt;/SPAN&gt; sex ;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;model&lt;/SPAN&gt; time*event&amp;amp;var(&lt;SPAN class="s3"&gt;&lt;STRONG&gt;0&lt;/STRONG&gt;&lt;/SPAN&gt;)=factor age weight / &lt;SPAN class="s1"&gt;rl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="s1"&gt;output&lt;/SPAN&gt; parameterestimates = CorrelationEstimate;&lt;/P&gt;&lt;P class="p2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 13:55:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205545#M11051</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2015-06-15T13:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205546#M11052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rick&lt;/P&gt;&lt;P&gt;A very interesting approach indeed. I even like it actually&lt;/P&gt;&lt;P&gt;BUT&lt;/P&gt;&lt;P&gt;there is a small problem: as you can see from my code, i am using the looping variable for 3 things:&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;%let&lt;/SPAN&gt; var=1;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s2" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;phreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;data&lt;/SPAN&gt;=have ;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;strata&lt;/SPAN&gt; country;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;class&lt;/SPAN&gt; sex ;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;model&lt;/SPAN&gt; time*event&lt;STRONG style="text-decoration: underline;"&gt;&amp;amp;var(&lt;SPAN class="s3" style="font-style: inherit; font-family: inherit;"&gt;0&lt;/SPAN&gt;)&lt;/STRONG&gt;=factor&lt;STRONG style="text-decoration: underline;"&gt;&amp;amp;var&lt;/STRONG&gt; age weight / &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;rl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;output&lt;/SPAN&gt; parameterestimates = CorrelationEstimate&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&amp;amp;var&lt;/STRONG&gt;&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Your suggestion would solve the second and the third one, but I am also modelling for event1-20&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Any suggestions on how to accommodate this in your code?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Thanks again&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 16:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205546#M11052</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-15T16:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205547#M11053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The data reshape will take care of that. The last instance of &amp;amp;var becomes unnecessary.&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="10634" __jive_macro_name="document" class="jive_macro jive_macro_document" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data flipped;&lt;/P&gt;&lt;P&gt;set have;&lt;/P&gt;&lt;P&gt;array event(20) event1-event20;&lt;/P&gt;&lt;P&gt;array factor(20) factor1-factor20;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do group=1 to 20;&lt;/P&gt;&lt;P&gt;event_group=event(i);&lt;/P&gt;&lt;P&gt;factor_group=factor(i);&lt;/P&gt;&lt;P&gt;output;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s2" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s2" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;phreg&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;data&lt;/SPAN&gt;=flipped;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;by group;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;strata&lt;/SPAN&gt; country;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;class&lt;/SPAN&gt; sex ;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;model&lt;/SPAN&gt; time*event&lt;STRONG style="text-decoration: underline;"&gt;_group&lt;/STRONG&gt;=factor&lt;STRONG style="text-decoration: underline;"&gt;_group&lt;/STRONG&gt; age weight / &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;rl&lt;/SPAN&gt;;&lt;/P&gt;&lt;P class="p1" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ods&lt;/SPAN&gt; &lt;SPAN class="s1" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;output&lt;/SPAN&gt; parameterestimates = CorrelationEstimate;&lt;/P&gt;&lt;P class="p2" style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;run&lt;/STRONG&gt;&lt;SPAN class="s4" style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 16:55:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205547#M11053</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-15T16:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205548#M11054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Correct me if I am wrong Reeza, but I think this code works if event1-20 are mutually exclusive.&lt;/P&gt;&lt;P&gt;In my case the same person may have event1 and event3&lt;/P&gt;&lt;P&gt;The same thing is with factor1-20, they are not mutually exclusive&lt;/P&gt;&lt;P&gt;What do you think?&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Cheers &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 19:45:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205548#M11054</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-15T19:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205549#M11055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try it.&lt;/P&gt;&lt;P&gt;It doesn't matter if they're mutually exclusive or not since you have a record for each, and your code doesn't account for that in the initial program anyways.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 19:46:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205549#M11055</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-06-15T19:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: Looping with a macro variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205550#M11056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am officially impressed! It did work!&lt;/P&gt;&lt;P&gt;Big thanks to Rick and Reeza&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Jun 2015 21:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Looping-with-a-macro-variable/m-p/205550#M11056</guid>
      <dc:creator>ammarhm</dc:creator>
      <dc:date>2015-06-15T21:47:06Z</dc:date>
    </item>
  </channel>
</rss>

