I have a question on match-merging. Can someone pls help, or direct me to where I can find a forum dedicated to base sas topics?
I don't understand why the 2nd obs in the output shows 32 for age. Shouldn't values from xx OVERWRITE values in yy when the BY variable matches? I expected age to be 23. My merge statement says: merge yy xx;
input name $ age $ height;
Adam 23 160
infile cards dsd dlm=' ';
input name $ age $ weight;
Adam 32 180
When merging your data the SAS matched the first observation from your first data set to teh first observation of your second data set. On the second pass you dont get a match, but rather you get the values retain from the first match and any the values from the second observaton of your first data set overwrite and liked named vars values.
If you want a good paper that covers this in detail I suggest you read: http://dc-sug.org/merge.pdf Robert does an outstanding job at showing just the this case and many more.