Existing command merge has all new syntax. It is easier to use,
easier to read, and makes it less likely that you will make a mistake.
Merges are classified as 1:1, 1:m, m:1, and m:m.
When you type merge 1:1, you are saying that you expect the
observations to match one-to-one. merge 1:m specifies a
1-to-many merge; m:1, a many-to-1 merge; and m:m, a
many-to-many merge. New options assert() and keep() allow
you to specify what you expect the outcome to be and what you want to
keep from it. For instance,
. merge 1:1 subjid using filename, assert(match)
means that you expect all the observations in both datasets to match each
. merge 1:1 subjid using filename, assert(match using) keep(match)
specifies that you expect each observation to either match or be solely
from the using data and, assuming that is true, you want to keep only
Sorting of both the master and the using datasets is now automatic.
The new merge does not support merging multiple files in one step.
Merge the first two datasets, then merge that result with the next dataset,
and so on.
merge now aborts with error if variables are string in one
dataset and numeric in the other unless new option force
The old merge syntax continues to work.