Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. Which type of integrity constraint would you place on the variable StoreID to ensure that there are no missing values and that there are no duplicate values?
    1. UNIQUE
    2. CHECK
    3. PRIMARY KEY
    4. NOT NULL
  2. Which code creates an audit trail on the SAS data set Reports.Quarter1?
    1. proc datasets nolist;
         audit quarter1;
         initiate;
      quit;
    2. proc datasets lib=reports nolist;
         audit initiate reports.quarter1;
      quit;
    3. proc datasets lib=reports nolist;
         initiate audit quarter1;
      quit;
    4. proc datasets lib=reports nolist;
         audit quarter1;
         initiate;
      quit;
  3. Which DATA step uses the transaction data set Records.Overnight to update the master data set Records.Snowfall by accumAmt?
    1. data records.snowfall;
         modify records.snowfall records.overnight
         key=accumAmt;
      run;
    2. data records.snowfall;
         modify records.overnight records.snowfall;
         by accumAmt;
      run;
    3. data records.snowfall;
         modify records.snowfall records.overnight;
         by accumAmt;
      run;
    4. data records.snowfall;
         modify records.snowfall records.overnight;
         update accumAmt;
      run;
  4. The automatic variable _IORC_ is created when you use the MODIFY statement with a BY statement or the KEY= option. How can you use the value of _IORC_?
    1. to determine whether the index specified on the KEY= option is a valid index
    2. to determine the number of observations that were updated in the master data set
    3. to determine the status of the I/O operation
    4. to determine the number of observations that could not be updated in the master data set
  5. Which PROC DATASETS step creates an integrity constraint named val_age on the data set Survey to ensure that values of the variable Age are greater than or equal to 18?
    1. proc datasets nolist;
         modify age;
         ic create val_age=check(where=(age>=18));
      quit;
    2. proc datasets nolist;
         modify Survey;
         ic create val_age=check(age>=18);
      quit;
    3. proc datasets nolist;
         modify survey;
         integrity constraint
                   val_age=check(where=(age>=18));
      quit;
    4. proc datasets nolist;
         modify survey;
         ic create val_age=check(where=(age>=18));
      quit;
  6. Which statement about using the MODIFY statement in a DATA step is true?
    1. MODIFY creates a second copy of the data while variables in the data are being matched with a WHERE clause and then deletes the second copy.
    2. You cannot modify the descriptor portion of the data set using the MODIFY statement.
    3. You can use the MODIFY statement to change the name of a variable.
    4. If the system terminates abnormally while a DATA step that is using the WHERE statement is processing, SAS automatically saves a copy of the unaltered data set.
  7. Which of the following statements about audit trails is true?
    1. They create historical versions of data so that a copy of the data set is saved each time the data is replaced.
    2. They record information about changes to observations in a data set each time the data set is replaced.
    3. They record information about changes to observations in a data set each time the data is modified in place.
    4. The audit trail file has the same name as the SAS data file that it is monitoring, but has #AUDIT at the end of the data set name.
  8. Which code initiates generation data sets on the existing SAS data set Sasuser.Amounts and specifies that five historical versions are saved in addition to the base version?
    1. proc datasets lib=sasuser nolist;
         modify Amounts (genmax=6);
      quit;
    2. proc datasets lib=sasuser nolist;
         modify Amounts (genmax=5);
      quit;
    3. proc datasets lib=sasuser nolist;
         modify Amounts (gennum=6);
      quit;
    4. proc datasets lib=sasuser nolist;
         modify Amounts (gennum=5);
      quit;
  9. Which statement about using the KEY= option in the MODIFY statement is true?
    1. SAS locates the variables to update using the index specified in the KEY= option and then automatically overlays nonmissing transaction values as it does when you use the MODIFY or BY statements.
    2. When you use the KEY= option, you must explicitly state the update that you want to make. SAS does not automatically overlay nonmissing transaction values.
    3. The KEY= option is used to specify a variable to match for updating observations.
    4. The index named in the KEY= option must be a simple index.
  10. Which code deletes all generations of the data set Sasuser.Amounts including the base data set?
    1. proc datasets lib=sasuser nolist;
         delete amounts (gennum=ALL);
      quit;
    2. proc datasets lib=sasuser nolist;
         delete amounts (gennum=HIST);
      quit;
    3. proc datasets lib=sasuser nolist;
         delete amounts (gennum=0);
      quit;
    4. proc datasets lib=sasuser nolist;
         delete amounts;
      quit;
..................Content has been hidden....................

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