BookmarkSubscribeRSS Feed
swayto
Fluorite | Level 6

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.

4 REPLIES 4
ChrisNZ
Tourmaline | Level 20

I suspect you want

Payment=Amount*Rate/(12*Months);

or

Payment=Amount*Rate/12/Months;

 

Shmuel
Garnet | Level 18

When you say wrong results, you should post

what you get and what you expect.

swayto
Fluorite | Level 6

 Obs Account Amount Rate Months Payment123456789

1092$22,00010.00%6011000.0
1731$114,0009.50%360324900.0
1289$10,00010.50%363150.0
3144$3,50010.50%12367.5
1135$8,70010.50%241827.0
1994$18,50010.00%609250.0
2335$5,00010.50%482100.0
3864$87,5009.50%360249375.0
3891$30,0009.75%36087750.0
Shmuel
Garnet | Level 18

Please explain what is wrong in the results.

What do expect the results to be ?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1343 views
  • 0 likes
  • 3 in conversation