<?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: Missing values incorrectly generated by finance('rate') function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542302#M149836</link>
    <description>&lt;P&gt;I can't find any details of a relevant hotfix that would resolve this, I'd rather go forearmed to sas admins, it's not usually an easy discussion (i.e. if I say, can you install hotfixes, then this doesn't solve the problem, I then have to go and ask them again so I'd rather just suggest something I'm confident will actually fix it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I found an alternative code solution in SAS - namely proc loan. Requires more coding as you can't pass a dataset to proc loan, so I need to pass each bit of data individually through some horrible macro code, then pick up the output each time and append it together. It's not a particularly good solution, but I can use it as an exception process....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  proc loan;
      fixed amount=1461.48 payment=162.45 life=9;
   run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 12 Mar 2019 09:23:29 GMT</pubDate>
    <dc:creator>dmcwool</dc:creator>
    <dc:date>2019-03-12T09:23:29Z</dc:date>
    <item>
      <title>Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/541971#M149743</link>
      <description>&lt;P&gt;I have an issue with the finance('rate', , ,) function.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;27         data _null_;
28           rate=FINANCE('rate',9,-162.45,1461.48);
29           put rate=;
30         run;

NOTE: Invalid argument to function FINANCE('rate',9,-162.45,1461.48) at line 28 column 8.
rate=.
rate=. _ERROR_=1 _N_=1
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 28:8   
NOTE: DATA statement used (Total process time):
      real time           0.36 seconds
      cpu time            0.04 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I attempt the same calculation in excel (=RATE(9,162.45, -1461.48)*12) , I get a value, so the calculation is valid (also I am attempting this calculation on thousands of rows, this issue only impacts a handful).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have searched SAS support and found the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/kb/55/525.html" target="_self"&gt;http://support.sas.com/kb/55/525.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;suggesting this might be resolved by a hotfix&amp;nbsp;&lt;SPAN&gt;Base SAS 9.3_M2&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However current version here is&amp;nbsp;9.04.01M4P110916.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions, or this better going via SAS administration on site here?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 11:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/541971#M149743</guid>
      <dc:creator>dmcwool</dc:creator>
      <dc:date>2019-03-11T11:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/541973#M149745</link>
      <description>&lt;P&gt;Talk to your sas-admin, using 9.5m5, i get the expected result:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;26         data _null_;
27         rate=FINANCE('rate',9,-162.45,1461.48);
28         put rate=;
29         run;

rate=0.000077995
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

30         
31         %put &amp;amp;=SYSVLONG4;
SYSVLONG4=9.04.01M5P09132017&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 12:07:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/541973#M149745</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-11T12:07:07Z</dc:date>
    </item>
    <item>
      <title>Re: Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/541998#M149751</link>
      <description>&lt;P&gt;Thanks - upgrade of the sas version is likely to be a long running battle, just on the off-chance, anyone got a code workaround for this?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 13:10:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/541998#M149751</guid>
      <dc:creator>dmcwool</dc:creator>
      <dc:date>2019-03-11T13:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542142#M149798</link>
      <description>The admins should - at least - check if a hotfix is available for the installed version.</description>
      <pubDate>Mon, 11 Mar 2019 17:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542142#M149798</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-11T17:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542302#M149836</link>
      <description>&lt;P&gt;I can't find any details of a relevant hotfix that would resolve this, I'd rather go forearmed to sas admins, it's not usually an easy discussion (i.e. if I say, can you install hotfixes, then this doesn't solve the problem, I then have to go and ask them again so I'd rather just suggest something I'm confident will actually fix it).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I found an alternative code solution in SAS - namely proc loan. Requires more coding as you can't pass a dataset to proc loan, so I need to pass each bit of data individually through some horrible macro code, then pick up the output each time and append it together. It's not a particularly good solution, but I can use it as an exception process....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  proc loan;
      fixed amount=1461.48 payment=162.45 life=9;
   run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 09:23:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542302#M149836</guid>
      <dc:creator>dmcwool</dc:creator>
      <dc:date>2019-03-12T09:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542304#M149838</link>
      <description>&lt;P&gt;You don't need macro code, just call execute:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
   input amountVar paymentVar lifeVar;
   datalines;
1461.48 162.45 9
3000 150 20
run;

data _null_;
   set have end=jobDone;

   if _n_ = 1 then do;
      call execute('proc loan noprint outsum=work.loans;');
   end;

   call execute(catx(' ', 'fixed amount=', amountVar, 'payment=', paymentVar, 'life=', lifeVar, ';'));

   if jobDone then do;
      call execute('run;');
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Mar 2019 09:38:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542304#M149838</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-03-12T09:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Missing values incorrectly generated by finance('rate') function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542308#M149841</link>
      <description>&lt;P&gt;Good point, thank you. Still not as neat as a single line sas function, however.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 09:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-values-incorrectly-generated-by-finance-rate-function/m-p/542308#M149841</guid>
      <dc:creator>dmcwool</dc:creator>
      <dc:date>2019-03-12T09:53:58Z</dc:date>
    </item>
  </channel>
</rss>

