Personal information such as name, age, weight, and height.
Use MERGE with BY to match rows on a shared key such as id.
Personal information such as name, age, weight, and height.
The shared id plus a calculated BMI value.
Start with a clear shared key.
Sort both datasets by the key before merging.
PROC SORT with BY id puts the observations in the order SAS needs for a reliable match.
Two sources, one enriched result.
PROC SORT cannot find a dataset that has not been created.
Datasets in WORK are lost when the SAS session ends.
Both tables need a usable key for the intended match.
SET creates the useful pieces. MERGE and BY connect them.
Once the two datasets are sorted by the same key, SAS can turn separate tables into one enriched dataset.