<?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: How to do math in a loop body? in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597115#M16095</link>
    <description>yes, that helped:) comma!&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
    <pubDate>Wed, 16 Oct 2019 21:42:31 GMT</pubDate>
    <dc:creator>muskagap</dc:creator>
    <dc:date>2019-10-16T21:42:31Z</dc:date>
    <item>
      <title>How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597105#M16087</link>
      <description>&lt;P&gt;Hello, first off - I'm a begginer, please take it into account;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that I can't do simple math within loop body. I need to calculate interest capitalization after 5 years. Starting amount is 5000 USD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data xyz.Capit;&lt;/P&gt;&lt;P&gt;amount = 5000;&lt;/P&gt;&lt;P&gt;i=1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do while (i &amp;lt;= 5);&lt;/P&gt;&lt;P&gt;i + 1;&lt;/P&gt;&lt;P&gt;option1 = amount*(1,04/1);&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This code can't be executed, shows errors (sth about aritmethical error). What's wrong with it?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 21:29:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597105#M16087</guid>
      <dc:creator>muskagap</dc:creator>
      <dc:date>2019-10-16T21:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597109#M16090</link>
      <description>&lt;P&gt;What does the log show as errors?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please include the log.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294893"&gt;@muskagap&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello, first off - I'm a begginer, please take it into account;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My problem is that I can't do simple math within loop body. I need to calculate interest capitalization after 5 years. Starting amount is 5000 USD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data xyz.Capit;&lt;/P&gt;
&lt;P&gt;amount = 5000;&lt;/P&gt;
&lt;P&gt;i=1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;do while (i &amp;lt;= 5);&lt;/P&gt;
&lt;P&gt;i + 1;&lt;/P&gt;
&lt;P&gt;option1 = amount*(1,04/1);&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code can't be executed, shows errors (sth about aritmethical error). What's wrong with it?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 21:33:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597109#M16090</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-16T21:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597110#M16091</link>
      <description>ERROR 388-185: Expecting an arithmetic operator.&lt;BR /&gt;&lt;BR /&gt;ERROR 200-322: The symbol is not recognized and will be ignored.</description>
      <pubDate>Wed, 16 Oct 2019 21:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597110#M16091</guid>
      <dc:creator>muskagap</dc:creator>
      <dc:date>2019-10-16T21:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597111#M16092</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294893"&gt;@muskagap&lt;/a&gt;&amp;nbsp; Are you after this formula and result by any chance?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Capit;

amount = 5000;

i=1;
do while (i &amp;lt;= 5);
amount = amount*(1.04/1);
output;
i + 1;
end;

run;

proc print noobs;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;RESULT:&lt;/P&gt;
&lt;DIV class="branch"&gt;
&lt;DIV&gt;
&lt;DIV align="center"&gt;
&lt;TABLE class="table" summary="Procedure Print: Data Set WORK.CAPIT" frame="box" rules="all" cellspacing="0" cellpadding="5"&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class="r header" scope="col"&gt;amount&lt;/TH&gt;
&lt;TH class="r header" scope="col"&gt;i&lt;/TH&gt;
&lt;/TR&gt;
&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;5200.00&lt;/TD&gt;
&lt;TD class="r data"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;5408.00&lt;/TD&gt;
&lt;TD class="r data"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;5624.32&lt;/TD&gt;
&lt;TD class="r data"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;5849.29&lt;/TD&gt;
&lt;TD class="r data"&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="r data"&gt;6083.26&lt;/TD&gt;
&lt;TD class="r data"&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 16 Oct 2019 21:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597111#M16092</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-10-16T21:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597112#M16093</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/294893"&gt;@muskagap&lt;/a&gt; you have a comma rather than a dot.&lt;/P&gt;
&lt;P&gt;try this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data xyz.Capit;
amount = 5000;
i=1;
 
do while (i &amp;lt;= 5);
i + 1;
option1 = amount*(1.04/1);
end;

run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 21:35:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597112#M16093</guid>
      <dc:creator>VDD</dc:creator>
      <dc:date>2019-10-16T21:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597114#M16094</link>
      <description>So the errors also indicate where exactly the issue is in the full log. Because you just posted the error I can't tell which part of the code it relates to. &lt;BR /&gt;&lt;BR /&gt;Assuming you're not using a French or different version of SAS, the comma issue noted may be the overall issue. &lt;BR /&gt;&lt;BR /&gt;Is the error at that location in the code?</description>
      <pubDate>Wed, 16 Oct 2019 21:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597114#M16094</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-10-16T21:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597115#M16095</link>
      <description>yes, that helped:) comma!&lt;BR /&gt;&lt;BR /&gt;thanks!</description>
      <pubDate>Wed, 16 Oct 2019 21:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597115#M16095</guid>
      <dc:creator>muskagap</dc:creator>
      <dc:date>2019-10-16T21:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to do math in a loop body?</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597409#M16148</link>
      <description>&lt;P&gt;You may also want to investigate the SAS Finance function. The function has options to do a number of standard financial calculations such as accrued interest, interest paid between dates, more than 30 such calculations are available from the Finance function. Plus there are about another 30 functions for financial calculations.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 16:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-do-math-in-a-loop-body/m-p/597409#M16148</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-10-17T16:05:51Z</dc:date>
    </item>
  </channel>
</rss>

