03-09-2016 11:25 PM
Depends on if you have multiple instances of your BY variables.
There's several good write ups on data step vs sql joins - search on lexjansen.com
03-10-2016 02:09 AM
SQL will give you the cartesian product, while the data step will give you as many records for a given by value as were present in one of the input datasets.
dataset a has 2 records for x = 1, while dataset b has 3.
SQL (join on a.x = b.x) will give you six records (all combinations), the data step merge (by x; with if a or b 3.