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: d
Before you can perform
BY-group processing, your data must follow a pattern. If your data
is not ordered or grouped in some pattern, BY-group processing results
in an error.
Correct answer: a
In the DATA step, during
BY-group processing only, the temporary variables FIRST.variable and
LAST.variable are available
for DATA step programming, but they do not appear in the output data
set.
Correct answer: c
The SORT procedure sorts
the data Cert.Credit by the variable Type in ascending order. You
do not have to specify the order in the BY statement in PROC SORT
unless you are sorting in DESCENDING order.
Correct answer: b
A BY group includes
all observations with the same BY value. If you use more than one
variable in a BY statement, a BY group is a group of observations
with the same combination of values for these variables. Each BY group
has a unique combination of values for the variables.
Correct answer: c
SAS determines FIRST.variable by
looking at each observation. When an observation is the first in a
BY group, SAS sets the value of the FIRST.variable to
1. This happens when the value of the variable changed from the previous
observation. For all other observations in the BY group, the value
of FIRST.variable is 0.
Correct answer: a
The SORT procedure sorts
the data Cert.Choices by the variable Day first, then Flavor in ascending
order, and finally writes the sorted data
set to Work.Choices.