is a method of processing
observations from one or more SAS data sets that are grouped or ordered
by values of one or more common variables.
BY variable
names a variable or
variables by which the data set is sorted. All data sets must be ordered
by the values of the BY variable.
BY value
is the value of the
BY variable.
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.
FIRST.variable and LAST.variable
are variables that
SAS creates for each BY variable. SAS sets FIRST.variable when
it is processing the first observation in a BY group, and sets LAST.variable when
it is processing the last observation in a BY group. These assignments
enable you to take different actions, based on whether processing
is starting for a new BY group or ending for a BY group.