PMT function

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

PMT function

[ Edited ]

Does the PMT function included in the SAS Analytics Pro?

I receive an error when use in data step:

ERROR 68-185: The function PMT is unknown, or cannot be accessed


Accepted Solutions
Solution
‎05-25-2018 11:38 AM
SAS Super FREQ
Posts: 4,245

Re: PMT function

The PMT function was introduced in SAS 9.3, so it should be available in Base SAS in a correctly installed 9.4 session.

Could you paste the log from running the following?

proc product_status; run;

View solution in original post


All Replies
SAS Super FREQ
Posts: 4,245

Re: PMT function

Please show your code and tell us your SAS Version. For example:

%put &=SYSVLONG;

data _null_;
/* The payment for a $5,000 loan earning a 12% nominal annual interest rate, that is to be paid back in five monthly payments */
P1 = PMT(.01/12, 5, 5000);
put P1=;
P = FINANCE("PMT",.01/12, 5, 5000);
put P=;
run;

prints the following in the SAS log:

13 %put &=SYSVLONG;
SYSVLONG=9.04.01M5P091317
14
15 data _null_;
16 /* The payment for a $5,000 loan earning a 12% nominal annual
16 ! interest rate, that is to be paid back in five monthly payments */
17 P1 = PMT(.01/12, 5, 5000);
18 put P1=;
19 P = FINANCE("PMT",.01/12, 5, 5000);
20 put P=;
21 run;

P1=1002.5013883
P=-1002.501388

Occasional Contributor
Posts: 11

Re: PMT function

I have SAS version 9.4. The code suggested by you returned the same error.

Solution
‎05-25-2018 11:38 AM
SAS Super FREQ
Posts: 4,245

Re: PMT function

The PMT function was introduced in SAS 9.3, so it should be available in Base SAS in a correctly installed 9.4 session.

Could you paste the log from running the following?

proc product_status; run;

Occasional Contributor
Posts: 11

Re: PMT function

For Base SAS Software ...
Custom version information: 9.4_M1
Image version information: 9.04.01M1P120413
For SAS/STAT ...
Custom version information: 13.1
For SAS/GRAPH ...
Custom version information: 9.4_M1
For SAS/IML ...
Custom version information: 13.1
For High Performance Suite ...
Custom version information: 2.2
Image version information: 9.04.01M0P022614
For SAS/ACCESS Interface to ODBC ...
Custom version information: 9.4_M1
SAS Super FREQ
Posts: 4,245

Re: PMT function

Since you do not have ETS installed you need to use the FINANCE function with first argument of 'PMT', as shown in my example. The FINANCE function should work for you.

 

When you said "The code suggested by you returned the same error" I assumed that you got errors for both calls. I now suspect that the FINANCE call succeeded. In the future, please paste the log, as I requested.

 

Occasional Contributor
Posts: 11

Re: PMT function

It worked! Thank you very much for your answer! I did not check the log for the FINANCE function. It did not return an error. I apologize for not pasting the log as requested. I will be more considerate next time. Sorry again!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 179 views
  • 4 likes
  • 2 in conversation