Small Script Showing Effect of Merge and Match-Merge ==================================================== data Fil1 ; input X Y A $; datalines; 1 3 ab 2 2 ab 1 4 bc 2 7 ac 2 8 dd 3 5 af 4 6 fw 7 7 hj ; run; data Fil2 ; input V W A $; datalines; 1 3 ab 1 4 bb 2 7 ac 2 8 dg 3 5 ab 4 6 fw ; run; proc sort data=Fil1 out=Fil1B; by A; proc sort data=Fil2 out=Fil2B; by A; options nocenter; data mrg1 ; merge Fil1 Fil2; proc print data=mrg1; run; Obs X Y A V W 1 1 3 ab 1 3 2 2 2 bb 1 4 3 1 4 ac 2 7 4 2 7 dg 2 8 5 2 8 ab 3 5 6 3 5 fw 4 6 7 4 6 fw . . 8 7 7 hj . . SO WE CAN SEE THAT ORDINARY MERGING (without `MATCH'ing) just brings together the two datasets with the same indexing for rows and adopts the LAST given elements for any doubly-defined columns. data mrg2 ; merge Fil1B Fil2B; by A ; proc print data=mrg2; run; Obs X Y A V W 1 1 3 ab 1 3 2 2 2 ab 3 5 3 2 7 ac 2 7 4 3 5 af . . 5 . . bb 1 4 6 1 4 bc . . 7 2 8 dd . . 8 . . dg 2 8 9 4 6 fw 4 6 10 7 7 hj . . BUT MATCH-MERGE BRINGS TOGETHER ALL OBSERVATIONS FROM BOTH SORTED DATASETS (in all possible ways, when the same observations occur more than once in a single dataset) using as many of the total set of columns as are properly defined for each occurring value of the BY-variable(s), and filling out the undefined values as "missing".