<?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: Calculating Balance Run Down in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculating-Balance-Run-Down/m-p/336749#M76368</link>
    <description>&lt;P&gt;Making some reasonable guesses about what your variable names are and what formulas should be applied:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;by AccountNumber;&lt;/P&gt;
&lt;P&gt;retain Expected_Balance;&lt;/P&gt;
&lt;P&gt;if first.AccountNumber then Expected_Balance = InitialLoanAmount;&lt;/P&gt;
&lt;P&gt;else do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Expected_Change = Expected_Balance * (1 + Interest) - Repayment;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Expected_Balance = Expected_Balance + Expected_Change;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This program is obviously untested, and assumes that your data set is sorted in order by AccountNumber AgeinMonths.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2017 21:40:00 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2017-02-28T21:40:00Z</dc:date>
    <item>
      <title>Calculating Balance Run Down</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-Balance-Run-Down/m-p/336683#M76350</link>
      <description>&lt;P&gt;I have a dataset that contains multiple rows per account.&amp;nbsp; The number of rows = the number of months since an account has been open, with the first row being zero.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The table shows how the balance has changed each row (month).&amp;nbsp; I would like to calculation what the expected balance change should have been had the customer kept to their agreed schedule of payments.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For the first row (where AgeInMonths = 0), the ExpectedBalance should always be equal to the InitialLoanAmount.&lt;/P&gt;&lt;P&gt;For subsequent rows, I need to work out what the ExpectedBalance&amp;nbsp;was for the row before and apply an Interest &amp;amp; Repayment calculation to that value to come up with that months ExpectedBalance.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to continue doing this until i get to a new AccountNumber where I should start again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how I would do this?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Jamie&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 18:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-Balance-Run-Down/m-p/336683#M76350</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2017-02-28T18:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Balance Run Down</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculating-Balance-Run-Down/m-p/336749#M76368</link>
      <description>&lt;P&gt;Making some reasonable guesses about what your variable names are and what formulas should be applied:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data want;&lt;/P&gt;
&lt;P&gt;set have;&lt;/P&gt;
&lt;P&gt;by AccountNumber;&lt;/P&gt;
&lt;P&gt;retain Expected_Balance;&lt;/P&gt;
&lt;P&gt;if first.AccountNumber then Expected_Balance = InitialLoanAmount;&lt;/P&gt;
&lt;P&gt;else do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Expected_Change = Expected_Balance * (1 + Interest) - Repayment;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; Expected_Balance = Expected_Balance + Expected_Change;&lt;/P&gt;
&lt;P&gt;end;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This program is obviously untested, and assumes that your data set is sorted in order by AccountNumber AgeinMonths.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 21:40:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculating-Balance-Run-Down/m-p/336749#M76368</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-02-28T21:40:00Z</dc:date>
    </item>
  </channel>
</rss>

