Data loan;
Input Account Amount Rate Months;
Rate=rate/100;
Payment=Amount* Rate/12 *Months;
Format Amount Dollar8. Rate percent10.2;
Datalines;
1092 22000 10.00 60
1731 114000 9.50 360
1289 10000 10.50 36
3144 3500 10.50 12
;
My assignment statement payment gives me wrong results.
I suspect you want
Payment=Amount*Rate/(12*Months);
or
Payment=Amount*Rate/12/Months;
When you say wrong results, you should post
what you get and what you expect.
Obs Account Amount Rate Months Payment123456789
1092 | $22,000 | 10.00% | 60 | 11000.0 |
1731 | $114,000 | 9.50% | 360 | 324900.0 |
1289 | $10,000 | 10.50% | 36 | 3150.0 |
3144 | $3,500 | 10.50% | 12 | 367.5 |
1135 | $8,700 | 10.50% | 24 | 1827.0 |
1994 | $18,500 | 10.00% | 60 | 9250.0 |
2335 | $5,000 | 10.50% | 48 | 2100.0 |
3864 | $87,500 | 9.50% | 360 | 249375.0 |
3891 | $30,000 | 9.75% | 360 | 87750.0 |
Please explain what is wrong in the results.
What do expect the results to be ?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.