Help using Base SAS procedures

DO Loop

Reply
N/A
Posts: 0

DO Loop

Hi All,

I use the code:-

/*NESTED DO*/
Data Earn;
do year=1 to 2;
capital+2000;
do month=1 to 3;
interest = capital*(.075/12);
capital+interest;
end;
end;
run;


Output: Interest=25.55 & Capital=4113.91

How is this output reached?Kindly suggest.

K
Super Contributor
Super Contributor
Posts: 3,174

Re: DO Loop

Posted in reply to deleted_user
You must code an OUTPUT statement. A SAS DATA step does have an implicit output operation but since you are in your DO/END loop technique, the only output would occur when the last statement is executed.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search argument, this topic / post:

data step output statement site:sas.com
Ask a Question
Discussion stats
  • 1 reply
  • 125 views
  • 0 likes
  • 2 in conversation