Unless you specify the NOTSORTED
or DESCENDING options, observations in the input data set must be
in ascending numeric or alphabetic order. To prepare the data set,
sort it with the SORT procedure using the same BY statement that you
plan to use in the target procedure. Alternatively, you can create
an appropriate index on the BY variables.
For more information
about indexes, see Understanding SAS Indexes in SAS Language Reference: Concepts.
If the procedure encounters
an observation that is out of order, an error message is generated.
If you need to group
data in some other order, such as chronological order, you can still
use BY-group processing. To do so, process the data so that observations
are arranged in contiguous groups that have the same BY-variable values
and specify the NOTSORTED option in the BY statement.