<?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: Do loops with non-integer index values for macros in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Do-loops-with-non-integer-index-values-for-macros/m-p/813#M42</link>
    <description>You can modify the code so that within the iterate macro, you divide the incoming parameters by 10.  The following sample code may help you -- no guarantees expressed or implied.&lt;BR /&gt;
&lt;BR /&gt;
I've changed the upper bounds of the &lt;I&gt;do&lt;/I&gt; loop to 20 instead of 2 as well.&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;%macro iterate(i,j);&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  temp_i= &amp;amp;i/10;&lt;BR /&gt;
  temp_j= &amp;amp;j/10;&lt;BR /&gt;
  call symput ("new_i",temp_i);&lt;BR /&gt;
  call symput ("new_j", temp_j);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%put "&amp;amp;new_i  &amp;amp;new_j";&lt;BR /&gt;
/*&lt;BR /&gt;
proc nlmixed data=dataset1;&lt;BR /&gt;
parms beta1=&amp;amp;new_i,&lt;BR /&gt;
beta2=&amp;amp;new_j,&lt;BR /&gt;
s2e=1,&lt;BR /&gt;
s2beta=1;&lt;BR /&gt;
&lt;BR /&gt;
model Y ~ normal(beta1+beta2+betavar,s2e);&lt;BR /&gt;
random betavar ~ normal(0,s2beta) subject=sid;&lt;BR /&gt;
run;&lt;BR /&gt;
*/&lt;BR /&gt;
%mend iterate;&lt;BR /&gt;
&lt;BR /&gt;
%macro looped;&lt;BR /&gt;
%do i=1 %to 20 %by 1;&lt;BR /&gt;
%do j=1 %to 20 %by 1;&lt;BR /&gt;
%iterate(&amp;amp;i,&amp;amp;j);&lt;BR /&gt;
%end;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend looped;&lt;BR /&gt;
&lt;BR /&gt;
%looped;&lt;/I&gt;</description>
    <pubDate>Wed, 07 Jun 2006 14:06:13 GMT</pubDate>
    <dc:creator>Dave_SAS</dc:creator>
    <dc:date>2006-06-07T14:06:13Z</dc:date>
    <item>
      <title>Do loops with non-integer index values for macros</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Do-loops-with-non-integer-index-values-for-macros/m-p/812#M41</link>
      <description>In proc NLmixed, I am attemping to run a loop that changes the starting parameter values. The do-loop will only allow me to step by integer values, but I need to step by values of 0.1. Here is what I have so far:&lt;BR /&gt;
&lt;BR /&gt;
%macro iterate(i,j);&lt;BR /&gt;
proc nlmixed data=dataset1;&lt;BR /&gt;
parms beta1=&amp;amp;i,&lt;BR /&gt;
beta2=&amp;amp;j,&lt;BR /&gt;
s2e=1,&lt;BR /&gt;
s2beta=1;&lt;BR /&gt;
&lt;BR /&gt;
model Y ~ normal(beta1+beta2+betavar,s2e);&lt;BR /&gt;
random betavar ~ normal(0,s2beta) subject=sid;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend iterate;&lt;BR /&gt;
&lt;BR /&gt;
%macro looped;&lt;BR /&gt;
%do i=1 %to 2 %by 1;&lt;BR /&gt;
%do j=1 %to 2 %by 1;&lt;BR /&gt;
%iterate(&amp;amp;i,&amp;amp;j);&lt;BR /&gt;
%end;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend looped;&lt;BR /&gt;
&lt;BR /&gt;
%looped;</description>
      <pubDate>Tue, 06 Jun 2006 17:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Do-loops-with-non-integer-index-values-for-macros/m-p/812#M41</guid>
      <dc:creator>DanielM</dc:creator>
      <dc:date>2006-06-06T17:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Do loops with non-integer index values for macros</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Do-loops-with-non-integer-index-values-for-macros/m-p/813#M42</link>
      <description>You can modify the code so that within the iterate macro, you divide the incoming parameters by 10.  The following sample code may help you -- no guarantees expressed or implied.&lt;BR /&gt;
&lt;BR /&gt;
I've changed the upper bounds of the &lt;I&gt;do&lt;/I&gt; loop to 20 instead of 2 as well.&lt;BR /&gt;
&lt;BR /&gt;
&lt;I&gt;%macro iterate(i,j);&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  temp_i= &amp;amp;i/10;&lt;BR /&gt;
  temp_j= &amp;amp;j/10;&lt;BR /&gt;
  call symput ("new_i",temp_i);&lt;BR /&gt;
  call symput ("new_j", temp_j);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
%put "&amp;amp;new_i  &amp;amp;new_j";&lt;BR /&gt;
/*&lt;BR /&gt;
proc nlmixed data=dataset1;&lt;BR /&gt;
parms beta1=&amp;amp;new_i,&lt;BR /&gt;
beta2=&amp;amp;new_j,&lt;BR /&gt;
s2e=1,&lt;BR /&gt;
s2beta=1;&lt;BR /&gt;
&lt;BR /&gt;
model Y ~ normal(beta1+beta2+betavar,s2e);&lt;BR /&gt;
random betavar ~ normal(0,s2beta) subject=sid;&lt;BR /&gt;
run;&lt;BR /&gt;
*/&lt;BR /&gt;
%mend iterate;&lt;BR /&gt;
&lt;BR /&gt;
%macro looped;&lt;BR /&gt;
%do i=1 %to 20 %by 1;&lt;BR /&gt;
%do j=1 %to 20 %by 1;&lt;BR /&gt;
%iterate(&amp;amp;i,&amp;amp;j);&lt;BR /&gt;
%end;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend looped;&lt;BR /&gt;
&lt;BR /&gt;
%looped;&lt;/I&gt;</description>
      <pubDate>Wed, 07 Jun 2006 14:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Do-loops-with-non-integer-index-values-for-macros/m-p/813#M42</guid>
      <dc:creator>Dave_SAS</dc:creator>
      <dc:date>2006-06-07T14:06:13Z</dc:date>
    </item>
  </channel>
</rss>

