Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. Which of the following is not written to the output during the compilation phase?
    1. the data set descriptor
    2. the first observation
    3. the program data vector
    4. the _N_ and _ERROR_ automatic variables
  2. During the compilation phase, SAS scans each statement in the DATA step, looking for syntax errors. Which of the following is not considered a syntax error?
    1. incorrect values and formats
    2. invalid options or variable names
    3. missing or invalid punctuation
    4. missing or misspelled keywords
  3. Unless otherwise directed, how does the DATA step execute?
    1. once for each compilation phase
    2. once for each DATA step statement
    3. once for each record in the input file
    4. once for each variable in the input file
  4. At the beginning of the execution phase, the value of _N_ is 1, the value of _ERROR_ is 0, and the values of the remaining variables are set to the following:
    1. 0
    2. 1
    3. undefined
    4. missing
  5. Suppose you run a program that causes three DATA step errors. What is the value of the automatic variable _ERROR_ when the observation that contains the third error is processed?
    1. 0
    2. 1
    3. 2
    4. 3
  6. Which of the following actions occurs at the beginning of an iteration of the DATA step?
    1. The automatic variables _N_ and _ERROR_ are incremental by one.
    2. The DATA step stops execution.
    3. The descriptor portion of the data set is written.
    4. The values of variables created in programming statements are reset to missing in the program data vector.
  7. Consider the following DATA step. Based on the sample input file below, in what order are the variables stored in the new SAS data set?
    data work.fin2; 
      set cert.finance;
      if Salary>25000 then Raise=0.03;
      else Raise=0.05;
      NewSalary=(Salary*Raise)+Salary;
    run;
    
    Cert.Finance Data Set
    1. SSN Name Salary Date Raise NewSalary
    2. Raise NewSalary SSN Name Salary Date
    3. NewSalary Raise SSN Name Salary Date
    4. SSN Name Date Salary Raise NewSalary
  8. What happens when SAS cannot interpret syntax errors?
    1. Data set variables contain missing values.
    2. The DATA step does not compile.
    3. The DATA step still compiles, but it does not execute.
    4. The DATA step still compiles and executes.
  9. What is wrong with this program?
    data work.fin2;
      set cert.finance;
      length Raise $9;
      if Salary>25000 then Raise='3 Percent';
        else Raise='5 Percent';
      if Salary>25000 then NewSalary=(25000*0.03)+Salary;
        else NewSalary=(Salary*0.05)+Salary;
      length Bonus $5;
      Bonus=Raise*0.02;
    run;
    1. There is a missing semicolon on the second line.
    2. There is a missing semicolon on the third line.
    3. The variables Bonus and Raise have the incorrect length.
    4. The variable type for Bonus is incorrect.
  10. Which procedure produces distinct values of variables and can be used to clean your data?
    1. PROC CONTENTS
    2. PROC MEANS
    3. PROC FREQ
    4. PROC PRINT
  11. 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.
Last updated: August 23, 2018
..................Content has been hidden....................

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