Chapter 11: Reading SAS Data Sets

  1. If you submit the following program, which variables appear in the new data set?
    data work.cardiac(drop=age group); 
       set clinic.fitness(keep=age weight group); 
       if group=2 and age>40; 
    run;
    
    1. none
    2. Weight
    3. Age, Group
    4. Age, Weight, Group
    Correct answer: b
    The variables Age, Weight, and Group are specified using the KEEP= option in the SET statement. After processing, Age and Group are dropped in the DATA statement.
  2. Which of the following programs correctly reads the data set Orders and creates the data set FastOrdr?
    1. data catalog.fastordr(drop=ordrtime); 
         set july.orders(keep=product units price); 
         if ordrtime<4; 
         Total=units*price; 
      run;
      
    2.  data catalog.orders(drop=ordrtime); set ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.