|
When I renamed the NAME variable in the outer query's From Clause and
selected NAME from the non-correlated subquery, guess what SAS exactly
complains about the absence of name field in the previously created
data file.
Proc sql ;
* Create a table with just the ages of the girls. ;
create table class_girls as
select age
from sashelp.class
where sex = 'F'
;
* Why doesn't this complain about the lack of a name field in the
class_girls dset? ;
* Instead it just returns everyone in sashelp.class. ;
select *
from sashelp.class(rename=(name=oldname))
where oldname in
(select name
from class_girls);
Quit ;
Log:
ERROR: The following columns were not found in the contributing
tables: name.
But, when I also selected OLDNAME instead of just NAME in the non-
correlated subquery SQL selects all records as did before.
select *
from sashelp.class(rename=(name=oldname))
where oldname in
(select oldname
from class_girls);
Any SAS Gurus aware of this issue, please explain.
Thanks!
Akshaya
|