Chapter 12: Reading SAS Data Sets

  1. 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. Correct answer: c
    You specify the data set to be created in the DATA statement. The DROP= data set option prevents variables from being written to the data set. Because you use the variable OrdrTime when processing your data, you cannot drop OrdrTime in the SET statement. If you use the KEEP= option in the SET statement, then you must list OrdrTime as one of the variables to be kept.
  3. Correct answer: d
    When you use the BY statement with the SET statement, the DATA step creates the temporary variables FIRST. and LAST. They are not stored in the data set.
  4. Correct answer: b
    The DATA step writes out observations at the end of the DATA step. However, in this program, the STOP statement stops processing before the end of the DATA step. An explicit OUTPUT statement is needed in order to produce an observation.
  5. Correct answer: d
    The program is attempting to read the first 4 observations and write the fifth observation to the data set Work.Subset. The number of observations that the FIRSTOBS option returns is greater than the number of observations that the OBS option returns. Therefore, the result is an error.
  6. Correct answer: a
    When you use the KEEP= data set option and the POINT= option with the OUTPUT and STOP statements, your program cannot write out a single observation.
  7. Correct answer: d
    This program uses the END= option to name a temporary variable that contains an end-of-file marker. That variable — last — is set to 1 when the SET statement reads the last observation of the data set.
  8. Correct answer: d
    At the bottom of the DATA step, the compilation phase is complete, and the descriptor portion of the new SAS data set is created. There are no observations because the DATA step has not yet executed.
  9. Correct answer: c
    The END= option enables you to write only one observation to the data set. The END= option overrides the DATA step default behavior of writing observations to the output.
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.148.103.210