BY statement in SAS proc compare

What is the difference between using the ID operator and the BY operator in comparing proc.

I understand the ID instruction - that when added observations are compared according to the ID. but what kind of BY statement does.

I read the SAS documentation and was looking for a network that I could not understand, could someone clarify it.

+4
source share
1 answer

As I understand it, the "by" operator makes a comparison. Proc makes a separate comparison for each group in the comparison datasets. It basically looks like starting a separate "proc compare" for each "by" group.

The id operator, on the other hand, matches key records between two matched data sets and messages about the number of common elements and the number in one data set, but not in the other. You would use this if your datasets have a common primary key, that is, a combination of variables that uniquely identify each record, and you want the โ€œprooc collationโ€ to take each matching pair and compare them.

+6
source

All Articles