SAS Chapter 18: Modifying SAS Data Sets And Tracking Changes

10 Questions | Total Attempts: 63

SettingsSettingsSettings
SAS Quizzes & Trivia

Practice for the SAS advance certification exam


Questions and Answers
  • 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?
    • A. 

      UNIQUE

    • B. 

      CHECK

    • C. 

      PRIMARY KEY

    • D. 

      NOT NULL

  • 2. 
    Which code creates an audit trail on the SAS data set Reports.Quarter1?
    • A. 

      proc datasets nolist; audit quarter1; initiate; quit;

    • B. 

      proc datasets lib=reports nolist; audit initiate reports.quarter1; quit;

    • C. 

      proc datasets lib=reports nolist; initiate audit quarter1; quit;

    • D. 

      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?
    • A. 

      data records.snowfall; modify records.snowfall records.overnight key=accumAmt; run;

    • B. 

      data records.snowfall; modify records.overnight records.snowfall; by accumAmt; run;

    • C. 

      data records.snowfall; modify records.snowfall records.overnight; by accumAmt; run;

    • D. 

      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_?
    • A. 

      To determine whether the index specified on the KEY= option is a valid index

    • B. 

      To determine the number of observations that were updated in the master data set

    • C. 

      To determine the status of the I/O operation

    • D. 

      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 variableage are greater than or equal to 18?
    • A. 

      proc datasets nolist; modify age; ic create val_age=check(where=(age>=18)); quit;

    • B. 

      proc datasets nolist; modify Survey; ic create val_age=check(age>=18); quit;

    • C. 

      proc datasets nolist; modify survey; integrity constraint val_age=check(where=(age>=18)); quit;

    • D. 

      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?
    • A. 

      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.

    • B. 

      You cannot modify the descriptor portion of the data set using the MODIFY statement.

    • C. 

      You can use the MODIFY statement to change the name of a variable.

    • D. 

      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?
    • A. 

      They create historical versions of data so that a copy of the data set is saved each time the data is replaced.

    • B. 

      They record information about changes to observations in a data set each time the data set is replaced.

    • C. 

      They record information about changes to observations in a data set each time the data is modified in place.

    • D. 

      The audit trail file has the same name as the SAS data file 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?
    • A. 

      proc datasets lib=sasuser nolist; modify Amounts (genmax=6); quit;

    • B. 

      proc datasets lib=sasuser nolist; modify Amounts (genmax=5); quit;

    • C. 

      proc datasets lib=sasuser nolist; modify Amounts (gennum=6); quit;

    • D. 

      proc datasets lib=sasuser nolist; modify Amounts (gennum=5); quit;

  • 9. 
    Which statement about using the KEY= option in the MODIFY statement is true?
    • A. 

      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/BY statements.

    • B. 

      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.

    • C. 

      The KEY= option is used to specify a variable to match for updating observations.

    • D. 

      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?
    • A. 

      proc datasets lib=sasuser nolist; delete amounts (gennum=ALL); quit;

    • B. 

      proc datasets lib=sasuser nolist; delete amounts (gennum=HIST); quit;

    • C. 

      proc datasets lib=sasuser nolist; delete amounts (gennum=0); quit;

    • D. 

      proc datasets lib=sasuser nolist; delete amounts; quit;

Related Topics
Back to Top Back to top