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.
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.
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.
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.
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.
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.
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.
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.
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.