Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  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
  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 july.fastordr(keep=product units price);
         if ordrtime<4; 
         Total=units*price; 
      run;
    3. data catalog.fastordr(drop=ordrtime);
         set july.orders(keep=product units price 
                         ordrtime); 
         if ordrtime<4; 
         Total=units*price; 
      run;
    4. none of the above
  3. Which of the following statements is false when you use the BY statement with the SET statement?
    1. The data sets listed in the SET statement must be indexed or sorted by the values of the BY variable or variables.
    2. The DATA step automatically creates two variables, FIRST. and LAST., for each variable in the BY statement.
    3. FIRST. and LAST. identify the first and last observation in each BY group, respectively.
    4. FIRST. and LAST. are stored in the data set.
  4. There are 500 observations in the data set Usa. What is the result of submitting the following program?
    data work.getobs5; 
       obsnum=5; 
       set sasuser.usa(keep=manager payroll); 
       stop; 
    run;
    1. an error
    2. an empty data set
    3. continuous loop
    4. a data set that contains one observation
  5. The data set clinic.heart contains 20 observations. What is the result of submitting the following program?
    data work.subset;
    	set clinic.heart (firstobs=5 obs=4);
    run;
    1. The program executes with no WARNING or ERROR messages. The data set work.subset contains 4 observations.
    2. The program executes with no WARNING or ERROR messages. The data set work.subset contains 0 observations.
    3. The program executes with a WARNING message. The data set work.subset contains 4 observations.
    4. The program terminates execution because of an ERROR message. The data set work.subset contains 0 observations.
  6. Assuming that the data set Sasuer.Usa has five or more observations, what is the result of submitting the following program?
    data work.getobs5; 
       obsnum=5; 
       set sasuser.usa(keep=manager payroll) point=obsnum; 
       output; 
       stop; 
    run;
    1. an error
    2. an empty data set
    3. a continuous loop
    4. a data set that contains one observation
  7. What is the result of submitting the following program?
    data work.addtoend; 
       set clinic.stress2 end=last; 
       if last; 
    run;
    1. an error
    2. an empty data set
    3. a continuous loop
    4. a data set that contains the last observation from clinic.stress2
  8. At the start of DATA step processing, during the compilation phase, variables are created in the program data vector (PDV), and observations are set to which of the following:
    1. blank
    2. missing
    3. 0
    4. there are no observations.
  9. To override the DATA step default behavior that writes observations to output, what should you use in the DATA step?
    1. DROP= and KEEP= data set options
    2. OUTPUT statement
    3. END= option
    4. BY statement
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.222.185