Dear SAS community I'm working on a server, where I retrieve the data I need from a view. The view is a panel data, where we observe different persons over several years. What I discovered is that the view is connected to several other, smaller data sets, where there is one data set for each year. I can see this from the log as it shows me: NOTE. There were 100000000 observations read from the data set example.example2000
NOTE. There were 100000000 observations read from the data set example.example2001
NOTE. There were 100000000 observations read from the data set example.example2002
...
NOTE. There were 100000000 observations read from the data set example.example2020 When I retrieve data from this view, I seldomly need all years, say 2000-2010. Since there are several million observations, I would like to stop SAS from reading from all years, but with a where statement I can still see from the log that it reads all the datasets. Example of my code is: proc sql ;
create table my_table as
select * from example.example
where year>=2000 and year<=2010 ;
quit ; Something that quadrouples the run time is if I put the where statement in the "from", if I want to do some additional calculations, An example is shown below: proc sql ;
create table my_table as
select this as that, this_1 as that_2 ...
from (select this, this_1 ..., from example.example
where year>=2000 and year<=2010) ;
quit ; What I would like to know is if it is possible for me to tell SAS when I read from a view which data sets it should (or should not) access? So I could tell it something like (pseudocode): proc sql ;
create table my_table as
select * from example.example
where view acces databases: example.example2000, example.example2001 ... example.example2010;
quit ;
... View more