hello all, my goal with this code is the have only records from table A to be joined with only records that match the conditions, from table B, as to pull the columns from table B to complete my table.
Here is my code:
proc sql;
create table CombinedTable as select A.*, B.Phone_number,
B.Email, B.Home_address, B.Secondary address
from TableA as A left join TableB as B
on A.EmpName=B.Name and A.ZIP=B.ZIP;
quit;
As you can see, there are two conditions for the join because there are employees with the same name, so we are using EmpName and ZIP to confirm that we are receiving the employee info that belong in TableA. When I run this, I recieve records from table B that were not originally in Table A. This is an issue as I am only looking for employees in Table A, plus any employees that match the conditions from table B, to have their information joined.
Im not sure how to fix this or what to do. I though left joins only keep records from Table A, and only takes records that match from Table B
... View more