Hi, I am currently using SAS Enterprise Guide, and wish to merge two data sets based on a common variable. I wish to do a left join I believe, as I wish to keep every data row from the left table, and match with the right table to add an extra variable onto the left table. See below for an example Table1 Table2 Animal Name Age Colour Animal Weight Dog 1 5 Blue Dog 7 Cat 2 4 Black Cat 9 Fish 3 8 Blue Fish 2 Dog 4 6 Red Cat 1 2 Blue And I wish for it to end up as Merge Animal Name Age Colour Weight Dog 1 5 Blue 7 Cat 2 4 Black 9 Fish 3 8 Blue 2 Dog 4 6 Red 7 Cat 1 2 Blue 9 So some data from the right table may have to match up to many on the left. I am currently using this code : PROC SQL; CREATE TABLE Merge AS SELECT t1.Animal, t1.Name, t2.Colour, FROM Table1 t1 LEFT JOIN Table2 t2 ON (t1.animal = t2.animal); QUIT; However when I do this, Instead of keeping the original 5 data entries from table 1, i appear to result in more data entries, and as this is a large data file, i cannot easily single out where or what these extra rows are or where they came from. Thanks!
... View more