Comparing Modifying, Merging, and Updating Data Sets
The table that follows summarizes several differences
among the MERGE, UPDATE, and MODIFY statements.
Criterion
|
MERGE
|
UPDATE
|
MODIFY
|
---|---|---|---|
Data sets must be sorted
or indexed
|
Match-merge: Yes
One-to-one merge: No
|
Yes
|
No
|
BY values must be unique
|
No
|
Master data set: Yes
Transaction data set:
No
|
No
|
Can create or delete
variables
|
Yes
|
Yes
|
No
|
Number of data sets
combined
|
Any number
|
2
|
2
|
Processing missing values
|
Overwrites nonmissing
values from first data set with missing values from second data set
|
Default behavior: missing values in the transaction data ... |
Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.