Remember that common
variables might not have the same names. Manager and IDnum are the
only two variables listed that match according to type and description.
You can use the RENAME= option to rename one of these variables so
that they can be used as BY variables in the MERGE statement of the
DATA step.
Correct answer: b
In order to merge multiple
data sets in a DATA step, the data sets must have a common variable.
However, if there are variables that are common to at least two of
the input data sets, and if each input data set contains at least
one of these variables, then you can use subsequent DATA steps to
merge the data sets. You can also use a PROC SQL step to merge data
sets that do not have common variables.
Correct answer: d
You can use PROC SQL
to join data from data sets that do not have a single common variable
among them. If you create a new table with the result of an inner
join in a PROC SQL step, the resulting data set can be similar or
identical to the result of a DATA step match-merge.
Correct answer: a
In
a DATA step match-merge, SAS reads observations from the input data
sets sequentially and match-merges them with observations from other
input data sets. Combined observations are created when SAS reads
observations from all input data sets into the PDV. These observations,
as well as any observations that contain missing or nonmatched values,
are then written to the new data set. A PROC SQL join creates a Cartesian
product of matches and then eliminates nonmatching data.
Correct answer: c
You
can use multiple SET statements in one DATA step to combine observations
from several data sets. The data sets do not need to have a common
variable.
Correct answer: b
You
can use the MEANS procedure to create a new data set that contains
a summary statistic. The NOPRINT option suppresses the default report.
The OUTPUT statement routes the results from the MEANS procedure to
a new data set. The VAR statement specifies one or more numeric variables
from the input data set.
Correct answer: a
The
_N_ variable records how many times the DATA step has iterated. In
the example, _N_ is used to ensure that the first SET statement executes
only one time so the one observation is read from Sasuser.Summary,
but the end of file marker is not read. Since the values in the PDV
are not reinitialized after each DATA step iteration, the value of
CARGOSUM is retained throughout DATA step execution. Therefore, if
the value of Cargosum is $1000 in the first iteration, it will be
$1000 in each subsequent iteration as well.
Correct answer: d
Totalrev is the accumulator
variable of the sum statement, which is automatically initialized
with a value of 0. If the expression in a sum statement produces a
missing value, SAS replaces the missing value with a value of 0. As
the DATA step iterates, the sum statement retains the accumulator
variable so that it will accumulate a total.
Correct answer: d
You use the KEY= option
in a SET statement to cause SAS to use an index to combine data from
multiple data sets. When the SET statement with the KEY= option executes,
the program data vector must already contain a value for the indexed
variable. You cannot use WHERE processing on a data set that has been
read with the KEY= option within the same DATA step.
Correct answer: b
When you use the KEY=
option, SAS creates an automatic variable named _IORC_, which stands
for INPUT/OUTPUT Return Code. If the value of _IORC_ is zero, the
index search was successful. The _IORC_ variable is also created automatically
when you use a MODIFY statement in a DATA step.