To use a BY statement with PROC COMPARE, you must sort
both the base and comparison data sets by the BY variables. The nature
of the comparison depends on whether all BY variables are in the comparison
data set and, if they are, whether their attributes match the ones
of the BY variables in the base data set. The following table shows
how PROC COMPARE behaves under different circumstances:
|
|
All BY variables are
in the comparison data set and all attributes match exactly
|
Compares corresponding
BY groups
|
None of the BY variables
are in the comparison data set
|
Compares each BY group
in the base data set with the entire comparison data set
|
Some BY variables are
not in the comparison data set
|
Writes an error message
to the SAS log and terminates
|
Some BY variables have
different types in the two data sets
|
Writes an error message
to the SAS log and terminates
|