SAS OnlineTutorback||next

Try It! Construct a DO loop to execute UNTIL a condition is true.

Creating HTML output? Read this first.

  1. Copy the program below and paste it into the Program Editor window (or issue the command copy sashelp.oltutor..source).
    data work.retire;
       Savings=6000;
       Income=38000;
       do while(savings<1000000);
          Year+1;
          income+(income*.06);
          savings+(income*.20);
       end;
    run;
    proc print data=work.retire;
    run;
    
    
    Modify the DATA step to compute your savings for the number of years you expect to work or until Savings reaches $1,000,000 or more.

  2. Submit the DATA step and correct any errors; then print the data set.

    Return here and select Next.

Solution
back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA.
All rights reserved.

Terms of Use & Legal Information | Privacy Statement