<?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 Do loops with non-integer index values for macros in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/814#M388</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:20:25 GMT</pubDate>
    <dc:creator>DanielM</dc:creator>
    <dc:date>2006-06-06T17:20:25Z</dc:date>
    <item>
      <title>Do loops with non-integer index values for macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/814#M388</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:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/814#M388</guid>
      <dc:creator>DanielM</dc:creator>
      <dc:date>2006-06-06T17:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Do loops with non-integer index values for macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/815#M389</link>
      <description>We do not currently have a macro forum, the forum you have sent this question to is mainly for ODS, PRINT, REPORT and TABULATE. &lt;BR /&gt;
&lt;BR /&gt;
A good place to send this type of question would be to support@sas.com &lt;BR /&gt;
&lt;BR /&gt;
This will open a track for you with SAS Technical Support. This is very helpful when you have follow up questions as all the information is kept together within the tracking number given to you.&lt;BR /&gt;
&lt;BR /&gt;
Here is a valuable link that discusses the different ways of contacting SAS Technical Support:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/techsup/contact/index.html" target="_blank"&gt;http://support.sas.com/techsup/contact/index.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
To answer your question, you are correct as the %DO handles whole integer numbers, but here is a link that points to an FAQ with a work-around:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/faq/036/FAQ03635.html" target="_blank"&gt;http://support.sas.com/faq/036/FAQ03635.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
If you have any further questions regarding this issue please send e-mail to support@sas.com and we at SAS Technical Support will be happy to assist you.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Russ Tyndall</description>
      <pubDate>Tue, 06 Jun 2006 20:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/815#M389</guid>
      <dc:creator>Russ_SAS</dc:creator>
      <dc:date>2006-06-06T20:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Do loops with non-integer index values for macros</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/816#M390</link>
      <description>Not the correct forum but shouldn't stop you from getting an answer.&lt;BR /&gt;
&lt;BR /&gt;
%Macro NLLoop( StartI= , StopI= , ByI= ,&lt;BR /&gt;
               StartJ= , StopJ= , ByJ= ) ;&lt;BR /&gt;
&lt;BR /&gt;
%Local I J MacIterI MaxIterJ ;&lt;BR /&gt;
&lt;BR /&gt;
%Let MaxIterI = %SysEvalF( ( &amp;amp;StopI - &amp;amp;StartI ) / &amp;amp;ByI ) ;&lt;BR /&gt;
%Let MaxIterJ = %SysEvalF( ( &amp;amp;StopJ - &amp;amp;StartJ ) / &amp;amp;ByJ ) ;&lt;BR /&gt;
&lt;BR /&gt;
%Do I = 0 %To &amp;amp;MaxIterI ;&lt;BR /&gt;
  %Do J = 0 %To &amp;amp;MaxIterJ ;&lt;BR /&gt;
 &lt;BR /&gt;
 Proc NLMixed &lt;BR /&gt;
  Data = &amp;amp;DataIn ;&lt;BR /&gt;
  Parms Beta1  = %SysEvalF( &amp;amp;StartI + ( &amp;amp;ByI * &amp;amp;I ) ) ,&lt;BR /&gt;
        Beta2  = %SysEvalF( &amp;amp;StartJ + ( &amp;amp;ByJ * &amp;amp;J ) ) ,&lt;BR /&gt;
        S2E    = 1                                    ,&lt;BR /&gt;
        S2Beta = 1  ;&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;
  %End ;&lt;BR /&gt;
%End ;&lt;BR /&gt;
&lt;BR /&gt;
%Mend ;&lt;BR /&gt;
%Mend NLLoop ;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%NLLoop( DataIn = DataSet1 ,&lt;BR /&gt;
         StartI = 1 , StopI = 2 , ByI = 0.1 ,&lt;BR /&gt;
         StartJ = 1 , StopJ = 2 , ByJ = 0.1 )</description>
      <pubDate>Wed, 19 Jul 2006 21:01:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Do-loops-with-non-integer-index-values-for-macros/m-p/816#M390</guid>
      <dc:creator>TobyDunn_hotmail_com</dc:creator>
      <dc:date>2006-07-19T21:01:49Z</dc:date>
    </item>
  </channel>
</rss>

