<?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: Iterative procedure in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672557#M23451</link>
    <description>&lt;P&gt;If someone said to you: "I have a formula&amp;nbsp;k=(Tc-To)/(To-Tb), can you tell me what is the value of k?", what would your first question be?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jul 2020 14:48:25 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-07-27T14:48:25Z</dc:date>
    <item>
      <title>Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672522#M23441</link>
      <description>&lt;P&gt;Good Morning, my name is Thiago and I'm trying to do an interactive procedure to calculate real base and ceiling temperatures of beta model in tree growth.&lt;/P&gt;&lt;P&gt;I used a procedure described in an article (image below), however I do not understand the way it is done, since my SAS code is showing errors.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Thi_Oliveira_0-1595855423847.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47687iCD14CC1607D01AAA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Thi_Oliveira_0-1595855423847.png" alt="Thi_Oliveira_0-1595855423847.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;SAS code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temp;&lt;BR /&gt;k=(Tc-To)/(To-Tb);&lt;BR /&gt;l=(0.05**2)*(To-Tb)*((Tc-To)**k);&lt;BR /&gt;do i=0 to 10;&lt;BR /&gt;L[i+1]=l/(((Tc-Tb)**(k+1))*((1-L[i])**k));&lt;BR /&gt;U[i+1]=(l/(((Tc-Tb)**(k+1))*((1-U[i])))**(1/k);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data "temp" has the To, Tb and Tc values for the iteractive procedure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Someone could help about that?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 13:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672522#M23441</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T13:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672525#M23443</link>
      <description>&lt;P&gt;The obvious error in your code is that you have not assigned values to variables Tc To or Tb.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But for your future reference, you can't just simply say "SAS code is showing errors". You &lt;STRONG&gt;MUST&lt;/STRONG&gt; show us the log from SAS, with nothing chopped out, so that we can see the code in the log plus all WARNINGs NOTEs and ERRORs for the step that has the problem.&amp;nbsp;&lt;SPAN style="font-size: 10.5pt; font-family: 'Arial',sans-serif; color: #333333;"&gt;When providing the log, it is critical that you maintain the formatting of the log so we can see it exactly as SAS showed it to you, making it easier for us to use. To maintain the formatting of the log, click on the &amp;lt;/&amp;gt; icon and paste the log as text into the window that appears. DO NOT SKIP THIS STEP.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 13:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672525#M23443</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T13:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672530#M23445</link>
      <description>&lt;PRE&gt;176  data temp;
177  k=(Tc-To)/(To-Tb);
178  l=(0.05**2)*(To-Tb)*((Tc-To)**k);
179  do i=0 to 10;
180  L[i+1]=l/(((Tc-Tb)**(k+1))*((1-L[i])**k));
ERROR: Undeclared array referenced: l.
ERROR: Undeclared array referenced: l.
ERROR: Variable l has not been declared as an array.
ERROR: Variable l has not been declared as an array.
181  U[i+1]=(l/(((Tc-Tb)**(k+1))*((1-U[i])))**(1/k);
                                                   -
                                                   79
ERROR: Undeclared array referenced: U.
ERROR: Undeclared array referenced: U.
ERROR: Variable U has not been declared as an array.
ERROR 79-322: Expecting a ).

182  output;
ERROR: Variable U has not been declared as an array.
183  end;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;I'm sorry, but I forgot to share the SAS log.&lt;/P&gt;&lt;P&gt;Thanks PaigeMiler.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 13:29:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672530#M23445</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T13:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672539#M23447</link>
      <description>&lt;P&gt;In addition to the fact that I mentioned that you have not assigned values to the variables, you also need ARRAY statements to declare that L and U are arrays.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672539#M23447</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T14:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672549#M23448</link>
      <description>&lt;P&gt;It will be something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data temp;
k=(Tc-To)/(To-Tb);
l=(0.05**2)*(To-Tb)*((Tc-To)**k);
array L{i+1}=l/(((Tc-Tb)**(k+1))*((1-L{i}**k));
do i=0 to 10 by 1;
end;
run;&lt;/PRE&gt;&lt;P&gt;The error in log still occured:&lt;/P&gt;&lt;PRE&gt;269  data temp;
270  k=(Tc-To)/(To-Tb);
271  l=(0.05**2)*(To-Tb)*((Tc-To)**k);
272  array L{i+1}=l/(((Tc-Tb)**(k+1))*((1-L{i}**k));
           -
           124
             -
             22
             76
ERROR 124-185: The variable L has already been defined.

ERROR 22-322: Syntax error, expecting one of the following: an integer constant, *.

ERROR 76-322: Syntax error, statement will be ignored.

273  do i=0 to 10 by 1;
274  end;
275  run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.TEMP may be incomplete.  When this step was stopped there were 0
         observations and 6 variables.
WARNING: Data set WORK.TEMP was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;&lt;P&gt;When you said to assign values is such as initial values? Like L=0 .......&lt;/P&gt;&lt;P&gt;Could you help how to write this code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672549#M23448</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T14:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672554#M23450</link>
      <description>&lt;P&gt;Pick a simpler formula, provide values for the variables like Tc Tb To and show us what you expect to get for output from that data step for like 3 observations.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that you want to retain L and U and OUTPUT new versions in the loop instead of attempting to create 11 variables whose names start with L and U&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may give you an idea of how to create multiple records.&lt;/P&gt;
&lt;PRE&gt;data junk;
   Retain l 5;
   do i=0 to 5;
      output; /*being at the start of the loop the value
              of L going in is output*/
      l= l*5;
   end;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The [ ] in a data step are used only for array references.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:40:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672554#M23450</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-27T14:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672557#M23451</link>
      <description>&lt;P&gt;If someone said to you: "I have a formula&amp;nbsp;k=(Tc-To)/(To-Tb), can you tell me what is the value of k?", what would your first question be?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 14:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672557#M23451</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T14:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672567#M23454</link>
      <description>&lt;P&gt;Thanks for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "k" and "l" are just index to converge L and U in the iterative process. Such as the steps in image below:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ima1.png" style="width: 372px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47693i4E1D5E9C3A2A66E5/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ima1.png" alt="Ima1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Because the model sometimes provide exagered Tb(base or minimum) and Tc(ceiling or maximum) temperatures, and this iteration process try to solve this problem by calculting L and U for recalculted Tb and Tc.&lt;/P&gt;&lt;P&gt;In the process above To is&amp;nbsp;optimum temperature.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 15:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672567#M23454</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T15:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672607#M23461</link>
      <description>&lt;P&gt;Thanks for the answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The "k" and "l" are just index to converge L and U in the iterative process. Such as the steps in image below:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because the model sometimes provide exagered Tb(base or minimum) and Tc(ceiling or maximum) temperatures, and this iteration process try to solve this problem by calculting L and U for recalculted Tb and Tc.&lt;/P&gt;&lt;P&gt;In the process above To is&amp;nbsp;optimum temperature.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 16:22:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672607#M23461</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T16:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672611#M23462</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289719"&gt;@Thi_Oliveira&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks for the answer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "k" and "l" are just index to converge L and U in the iterative process. Such as the steps in image below:&lt;/P&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because the model sometimes provide exagered Tb(base or minimum) and Tc(ceiling or maximum) temperatures, and this iteration process try to solve this problem by calculting L and U for recalculted Tb and Tc.&lt;/P&gt;
&lt;P&gt;In the process above To is&amp;nbsp;optimum temperature.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't think this answers my question, which was:&amp;nbsp;&lt;SPAN&gt;If someone said to you: "I have a formula&amp;nbsp;k=(Tc-To)/(To-Tb), can you tell me what is the value of k?", what would your first question be?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 16:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672611#M23462</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T16:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672614#M23463</link>
      <description>&lt;P&gt;The "k" represents the range of temperatures where there are plant growth in the study.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 16:43:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672614#M23463</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T16:43:00Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672618#M23464</link>
      <description>&lt;P&gt;Well, ok, this isn't working.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You cannot calculate K if you don't have values for To, Tc and Tb. Correct?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, you have to tell SAS what the values of To, Tc and Tb are, or nothing gets calculated.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:05:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672618#M23464</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T17:05:11Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672622#M23465</link>
      <description>&lt;P&gt;Instead of a counted loop I think that you want a DO until (convergence). But you haven't said what the convergence limit would be. That would apparently be based on the two calculations. The iteration to track what has is happening probably should be a one record output for each iteration so you can see how values are changing. (i.e approaching convergence or not).&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:17:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672622#M23465</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-27T17:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672624#M23466</link>
      <description>&lt;P&gt;I inform the values of To, Tb and Tc.&lt;/P&gt;&lt;PRE&gt;data temp;
To=14;
Tb=4;
Tc=20;
k=(Tc-To)/(To-Tb);
l=(0.05**2)*(To-Tb)*((Tc-To)**k);
do i=1 to 50 by 1;
i+1= l/(((Tc-Tb)**(k+1))*((1-i)**k));
output;
end;
run;&lt;/PRE&gt;&lt;P&gt;However the log indicates an error:&lt;/P&gt;&lt;PRE&gt;416  data temp;
417  To=14;
418  Tb=4;
419  Tc=20;
420  k=(Tc-To)/(To-Tb);
421  l=(0.05**2)*(To-Tb)*((Tc-To)**k);
422  do i=1 to 50 by 1;
423  i+1= l/(((Tc-Tb)**(k+1))*((1-i)**k));
424  output;
425  end;
426  run;

NOTE: Division by zero detected at line 423 column 7.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
NOTE: Invalid argument(s) to the exponential operator "**" at line 423 column 32.
To=14 Tb=4 Tc=20 k=0.6 l=0.0732539013 i=51 _ERROR_=1 _N_=1
NOTE: Missing values were generated as a result of performing an operation on missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      49 at 423:25
NOTE: Mathematical operations could not be performed at the following places. The results of the
      operations have been set to missing values.
      Each place is given by: (Number of times) at (Line):(Column).
      1 at 423:7     49 at 423:32
NOTE: The data set WORK.TEMP has 50 observations and 6 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/PRE&gt;&lt;P&gt;Now, I don't know what is going on. In the article, the&amp;nbsp;authors have said to start with L=0 and then&amp;nbsp;proceed to the interaction until&amp;nbsp;convergence is achieved. However, I still thinking that I'm not writting on right way.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ima1.png" style="width: 372px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47706i953348DF10C0B425/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ima1.png" alt="Ima1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:18:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672624#M23466</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T17:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672626#M23467</link>
      <description>&lt;PRE&gt;data temp;&lt;BR /&gt;To=14;&lt;BR /&gt;Tb=4;&lt;BR /&gt;Tc=20;&lt;BR /&gt;k=(Tc-To)/(To-Tb);&lt;BR /&gt;array LL l1-l50;&lt;BR /&gt;ll(1)=(0.05**2)*(To-Tb)*((Tc-To)**k);&lt;BR /&gt;do i=1 to 49 by 1;&lt;BR /&gt;LL(i+1)= LL(1)/(((Tc-Tb)**(k+1))*((1-LL(i))**k));&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/PRE&gt;
&lt;P&gt;Does this do what you want? You know the forumlas, I don't.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672626#M23467</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-07-27T17:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672643#M23468</link>
      <description>&lt;P&gt;Thanks for the anwser. Do you have any example to share about this DO until convergence.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I made this SAS program, but did not work again, because I can not see any changes in values.&lt;/P&gt;&lt;PRE&gt;data temp;
To=14;
Tb=4;
Tc=20;
k=(Tc-To)/(To-Tb);
l=(0.05**2)*(To-Tb)*((Tc-To)**k);
do i=1 to 50 by 1;
i+1= l/(((Tc-Tb)**(k+1))*((1-i)**k));
output;
end;
run;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jul 2020 17:50:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672643#M23468</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T17:50:14Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672660#M23469</link>
      <description>&lt;P&gt;Thanks for the answer PaigeMiler. But, it isn't. I will share again the Appendix in the article.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ima1.png" style="width: 372px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47714i1D6B329F1C0FF87E/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ima1.png" alt="Ima1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I only have the values of To, Tb and Tc, all the other must be estimated.&lt;/P&gt;&lt;P&gt;Maybe I have to do a DO until code becasue I have to achieved the convergence, because in the end I only have one value of L and U (convergence), and this value I will sum in Tb (minimum temperature) and Tc (maximum temperature) to corret it.&lt;/P&gt;&lt;P&gt;I read a lot this example in the article but it is very confuse to understand this iterative procedure.&lt;/P&gt;&lt;P&gt;If we could continue to talk about this, I&amp;nbsp;I appreciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 18:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672660#M23469</guid>
      <dc:creator>Thi_Oliveira</dc:creator>
      <dc:date>2020-07-27T18:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672698#M23471</link>
      <description>&lt;P&gt;What do you think this this line of code does?&lt;/P&gt;
&lt;PRE&gt;i+1= l/(((Tc-Tb)**(k+1))*((1-i)**k));&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I seriously doubt it does what you think, such as calculate the next value of i, which would be poor practice in most cases with an iterated loop as it can lead to infinite loops.&lt;/P&gt;
&lt;P&gt;One example of why to be careful with modifying loop index variables inside a loop. The K counter is included to show what values of I look like at the end of the loop. The Leave instruction tells SAS to exit the loop when executed. It is easy to see that without that K and the Leave instruction the loop will never end.&lt;/P&gt;
&lt;PRE&gt;data example2;
   do i=1 to 10;
      i=i-1;
      k+1;
      if k&amp;gt;100 then leave;
      output;
   end;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use a calculated value inside a loop to control whether to continue you use a DO UNTIL or DO WHILE loop.&lt;/P&gt;
&lt;P&gt;A brief example:&lt;/P&gt;
&lt;PRE&gt;data example;
   j=7;
   do until (j le 0.1);
      j = j/3;&lt;BR /&gt;      output;
   end;
run;&lt;/PRE&gt;
&lt;P&gt;You assign (calculate an initial value). Then you test if the value "converges", i.e is in some specific range of values. Above the test if the current value of J is &amp;lt;= 0.1.&lt;/P&gt;
&lt;P&gt;If the comparison is false (not "converged") then the loop is entered. The J value, the loop control variable (or multiple variables) are recalculated. The the loop starts over with another test. The output shows the value at the bottom of the loop in this case. The last value for J shown will be the one that passed the comparison or "converged".&lt;/P&gt;
&lt;P&gt;So the structure of your program should be&lt;/P&gt;
&lt;P&gt;Establish all of the initial values, including your convergence criteria.&lt;/P&gt;
&lt;P&gt;Test the value(s) for convergence.&lt;/P&gt;
&lt;P&gt;If they don't converge then in the loop modify the calculation (all those K and K+1 variables), recalculate the convergence criteria value(s).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some hints: Do not use exactly equal as the boundary (convergence) criteria and appropriate GE or LE are safer.&lt;/P&gt;
&lt;P&gt;Test the code with a counter like my Example2 to break out of the loop after a few values so you can see if the values you need are moving in the expected manner.&lt;/P&gt;
&lt;P&gt;Output the values per iteration so you can see those. Sometimes you discover that you have missed adjusting one of the variables you intended to.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;back to this bit of code:&lt;/P&gt;
&lt;PRE&gt;l/(((Tc-Tb)**(k+1))*((1-i)**k));&lt;/PRE&gt;
&lt;P&gt;when i=1 then&lt;/P&gt;
&lt;PRE&gt;(1-i)**k)   is (1-1)**k
or 
0**k&lt;/PRE&gt;
&lt;P&gt;Which SAS will resolve as 0. So you have&lt;/P&gt;
&lt;P&gt;l/(((Tc-Tb)**(k+1))*0);&amp;nbsp;&amp;nbsp; See the problem yet?&lt;/P&gt;
&lt;P&gt;0* anything = 0. So you have&lt;/P&gt;
&lt;P&gt;l/0, throwing the divide by zero error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So some return to algebra is indicated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2020 21:45:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672698#M23471</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-27T21:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672763#M23477</link>
      <description>&lt;P&gt;This statement:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;i+1= l/(((Tc-Tb)**(k+1))*((1-i)**k));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;is a so-called &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.5&amp;amp;docsetId=lestmtsref&amp;amp;docsetTarget=n1dfiqj146yi2cn1maeju9wo7ijs.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;Sum Statement&lt;/A&gt;, and translates to this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;i = i + (1 = l/(((Tc-Tb)**(k+1))*((1-i)**k)));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;which means that you add the result of a &lt;EM&gt;comparison&lt;/EM&gt; to i, so you add either a 1 or a 0; since I doubt that the complex formula on the right will ever create an &lt;EM&gt;exact&lt;/EM&gt; 1, this statement does in essence nothing. See it as an honourable mention in this year's Obfuscated SAS Code Contest.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 10:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672763#M23477</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-07-28T10:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Iterative procedure</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672923#M23482</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/289719"&gt;@Thi_Oliveira&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this approach:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
/* Provide initial values and derived quantities */

To=14; Tb=4; Tc=20;
h=0.05;
c=10; /* Replace 10 with the real value of c in your application. */

k=(Tc-To)/(To-Tb);
j=h**(1/c)*(To-Tb)*(Tc-To)**k; /* (use j to avoid name conflict with L) */

eps=1e-12; /* used in convergence criterion (see chk_conv below) */
maxiter=1000; /* maximum number of iterations */

retain i L U 0; /* use RETAIN also to define variable order */
link chk_conv;
format dL dU best8.;
label L='L[i]'
      U='U[i]'
      dL='L[i] - L[i-1]'
      dU='U[i] - U[i-1]';

/* Perform iteration */

do i=0 to maxiter while(not conv);
  output;
  L=j/((Tc-Tb)**(k+1)*(1-L)**k);
  U=(j/((Tc-Tb)**(k+1)*(1-U)))**(1/k);
  link chk_conv;
end;

/* Compute final results (named Tb_ and Tc_) */

Tb_=Tb+L*(Tc-Tb);
Tc_=Tc-U*(Tc-Tb); /* Note the typo in the article! */
output;
return;

/* Check convergence criterion */

chk_conv:
  dL=dif(L);
  dU=dif(U);
  if i then conv=(.&amp;lt;abs(dL)&amp;lt;eps &amp;amp; .&amp;lt;abs(dU)&amp;lt;eps);
  return;
run;

proc print data=want label;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2020 17:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Iterative-procedure/m-p/672923#M23482</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2020-07-28T17:26:01Z</dc:date>
    </item>
  </channel>
</rss>

