Hello SAS Users - Here is an example that is baffling me and my team mate. data test; input name1 $ name2 $; datalines; AA BB CC DD EE FF HH PP ; run; data name; input code $; datalines; AA FF HH ; run; proc sql; create table result as select * from test where name1 in (select name1 from name) ; /*name1 doesn't exist in the "name" dataset */ quit ; NOTE: Table WORK.RESULT created, with 4 rows and 2 columns. The last proc sql step should result in an error because there is no field called "name1" in dataset name but it does not give us an error. Instead it does the search, and gives us the entire "test" dataset. But if I change the last proc sql to read like below: proc sql; create table result as select * from test where name1 in (select x from name); quit; ERROR: The following columns were not found in the contributing tables: x. Shouldn't I get an error response in both cases? Or maybe there is something I don't understand about SAS in this. Thank you for any insight you can provide.
... View more