Sentry Page Protection
Programming Tips 10
What if you don't sort the data sets prior to merging?
There will be an error message in the Log window and you won't be able to merge the data sets properly.
Example
The DS1 data set is not sorted by the merging variable (group).
Merging the two data sets without first sorting them by the merging variable will show an error message in the Log window.
Example
Data DS;
Merge DS1 DS2;
By group;
Run;
ERROR: BY variables are not properly sorted on data set WORK.DS1.
Merging unsorted data sets is one of the most common mistakes made by SAS beginner. Make sure you sort the data sets prior do merging any data sets!