BookmarkSubscribeRSS Feed
niladri_routray
Calcite | Level 5

In a fixed term deposit of 25 years calculate the total amount at the end of term with initial
amount of 5,00,00 and annual interest rate of 7% i) compounded annually II) compaunded monthly. show the amount accured at monthly level.

19 REPLIES 19
niladri_routray
Calcite | Level 5

I have not started yet. Please write code.

novinosrin
Tourmaline | Level 20

Hi, I'm afraid your question doesn't sound like or request that essentially is a favor and rather that sounds like an order in a open public technical forum which is unfair. Please rephrase with some courtesy and kindess, you are more likely to get any kind of help you need. I am only suggesting, and do not take this personal. Thank you and have a nice day!

niladri_routray
Calcite | Level 5

I am really sorry for your thoughts. I just started doing programming in SAS, thats why I posted this question and need a clue to start writing code. I did not know the protocol of this forum. If my question hurts anyone in this forum, I am saying sorry for that, no other intention.

 

LinusH
Tourmaline | Level 20

If you are new to SAS programming, I would suggest that you take the free online Programming 1 course. It will help develop your skills, and hopefully be able to direct more specific question on these forums in the future.

Data never sleeps
Kurt_Bremser
Super User

Hints:

In a data step, use a do loop. Set the initial amount before the loop. Calculate the increase in the loop (variable asssignment with simple mathematical formula), and use output to write a record (observation) to the target dataset.

ballardw
Super User

Look in the online help for SAS functions such as FINANCE.

Ksharp
Super User
If I was right.


data _null_;
year=0.07;
month=0.07/12;

do i=1 to 25;
 year_amount=50000*constant('e')**(year*i);
 put 'year=' i ' year amount=' year_amount;
end;

do i=1 to 25*12;
 month_amount=50000*constant('e')**(month*i);
 put 'month=' i ' month amount=' month_amount;
end;
run; 


niladri_routray
Calcite | Level 5

Hello,

 

Thanks for your reply.

while running the below code, I am getting following output.

year_amount=287730.13

and month_amount=287730.13

 

 

but calculation formula used in the code for year_amount and month_amount is differenet while output is same for both year_amount and month_amount.

Ksharp
Super User
Can you show us the formula and the output ?


niladri_routray
Calcite | Level 5

I used the code sent by you.

Ksharp
Super User
I mean the formula for compounded interest annually and monthly .



Ksharp
Super User
So you want sparse compound interest ,not continuous compound.



data _null_;
year=0.07;
month=0.07/12;

year_amount=50000;
do i=1 to 25;
 year_amount=year_amount*(1+year);
 put 'year=' i ' year amount=' year_amount;
end;

month_amount=50000;
do i=1 to 25*12;
 month_amount=month_amount*(1+month);
 put 'month=' i ' month amount=' month_amount;
end;
run; 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 19 replies
  • 2206 views
  • 7 likes
  • 7 in conversation