O'Reilly logo

SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 14: Generating Data with DO Loops

  1. Which statement is false regarding the use of DO loops?
    1. They can contain conditional clauses.
    2. They can generate multiple observations.
    3. They can be used to combine DATA and PROC steps.
    4. They can be used to read data.
    Correct answer: c
    DO loops are DATA step statements and cannot be used in conjunction with PROC steps.
  2. During each execution of the following DO loop, the value of Earned is calculated and is added to its previous value. How many times does this DO loop execute?
    data finance.earnings; 
       Amount=1000; 
       Rate=.075/12; 
       do month=1 to 12; 
          Earned+(amount+earned)*rate; 
       end; 
    run;
    
    1. 0
    2. 1
    3. 12
    4. 13
    Correct answer: c
    The number of iterations is determined by the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required