BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
smm662002
Quartz | Level 8

Hello,

 

SAS Version: 9.4 M5

 

I have tried to use the function FINANCE 'ppmt' with 0 interest rate but I have received the following warning:   

"NOTE: Argument 2 to function FINANCE('PPMT',0,2,120,1000000,0,0) at line 37 column 14 is invalid."

 

I have used the same parameters in PPMT function and it works.  The code I used is below and the result I was expecting from FINANCE ppmt is -8333.33. 

 


data test2;
temp_finance=finance('PPMT',0,2,120,1000000,0,0);  ===>  .
temp_ppm=ppmt(0,2,120,1000000,0,0);                          ===>8333.333
run;

 

 

data test1;
temp_finance=finance('PPMT',0.08,2,120,1000000,0,0);           ===> -8.42762968
temp_ppm=ppmt(0.08,2,120,1000000,0,0);                                   ===> 8.4276296798
run;

 

A similar issue has been raised for FINANCE 'pv' (Solved: Invalid argument to function FINANCE 'pv' with 0 interest rate - SAS Support Communities) and it looks like a bug.

 

Regards,

smm662002

 

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello,

 

The FINANCE function has a limitation which checks for (strictly) positive values for the "rate".  If a negative (or zero) value is passed, it will return the message in the SAS log that Argument 2 is invalid.
  
The PPMT functions do not have this limitation.  
Please use the PPMT function instead of the FINANCE function with the PPMT as the first argument. 

Here is the link to the documentation on the PPMT function:
  
https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=lefunctionsref&docsetT...

Good luck,

Koen

View solution in original post

5 REPLIES 5
sbxkoenk
SAS Super FREQ

Hello,

 

The FINANCE function has a limitation which checks for (strictly) positive values for the "rate".  If a negative (or zero) value is passed, it will return the message in the SAS log that Argument 2 is invalid.
  
The PPMT functions do not have this limitation.  
Please use the PPMT function instead of the FINANCE function with the PPMT as the first argument. 

Here is the link to the documentation on the PPMT function:
  
https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=lefunctionsref&docsetT...

Good luck,

Koen

smm662002
Quartz | Level 8

Hi Koen,

 

Thank you for your answer. 

It would be great if SAS documentation would clearly mention the limitations of FINANCE function. 

 

Regards,

smm662002

sbxkoenk
SAS Super FREQ

@smm662002 wrote:

It would be great if SAS documentation would clearly mention the limitations of FINANCE function. 

You are absolutely right.
I was also surprised this is not in the official doc.

 

You can provide feedback on the doc if you want.
See feedback button on the top right.

sbxkoenk_0-1690465616130.png

https://go.documentation.sas.com/doc/en/helpcenterwlcm/1.0/home.htm

 

Koen

 
IgorR
Quartz | Level 8

@sbxkoenk wrote:

Hello,

 

The FINANCE function has a limitation which checks for (strictly) positive values for the "rate".  If a negative (or zero) value is passed, it will return the message in the SAS log that Argument 2 is invalid.
  
The PPMT functions do not have this limitation.  
Please use the PPMT function instead of the FINANCE function with the PPMT as the first argument. 

Here is the link to the documentation on the PPMT function:
  
https://go.documentation.sas.com/?cdcId=pgmsascdc&cdcVersion=9.4_3.5&docsetId=lefunctionsref&docsetT...

Good luck,

Koen


Hi,

I have the same problem with Finance function.

I did resolve a problem with negative values for Rate by adding

*(1+Rate)**Nper;

after the function, but still have a problem for Zero value for rate.

I'm not sure that PPMT function can be a solution in my case, cause I need make calculation for negative values in Pmt as well, while PPMT function requires this parameter to be positive only.

Can you help in my case?

Here an example for numbers I made calculation on them.

I except to get r = 94 with given numbers:

Data AAA;
/*	Rate = -0.0138067061143984;*/
	Rate = 0;
/*	Rate = 1;*/
	Nper = 1;
	Pmt = -94;
	Pv = 0;
	Type = 1;
	r = Finance('Pv', Rate, Nper, Pmt, Pv, Type)*(1+Rate)**Nper;

Run;
sbxkoenk
SAS Super FREQ

Hello @IgorR ,

 

Can you make a new topic (new request)?

This topic is already closed (solved) and nobody will look into your follow-up question because of that.

 

Thanks,

Koen 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 616 views
  • 0 likes
  • 3 in conversation