While you merge the datasets thru. proc sql code, the identical variables are not overwritten, unlike datastep merge. This can be visualized when this code is run removing the "Create table tab3 as" statement.
It is rationale that the variable's name should be unique.
So, you can do either of the following.
A) Select variables explicitly from the datasets.
proc sql;
create table tab3 as
select a.id, a. from tab1 a, tab2 b
where a.id=b.id;
quit;
By this way, you are not asking SAS to keep two "ID" variables, which it wont.
B) Using datastep merge.
Hope this is is useful.
Thanks