SAS where condition exact matching -
thanks feedback guys, have rewrite question make more clear.
say, have table:
what trying table list of numbers have matching fp_ndt dates condition, example, want list of numbers, have fp_ndt not null 2014 , 2015 , missing values 2011, 2012 , 2013 (irrelevant of months). condition should number 4. possible table ?
ps: if write simple sql select statement , put condition
where year(fp_ndt) in (2014,2015)
it give me numbers 2 , 3...
why not first summarize data?
proc sql; create table xx select number , max(year(fp_ndt)=2011) yr2011 , max(year(fp_ndt)=2012) yr2012 , max(year(fp_ndt)=2013) yr2013 , max(year(fp_ndt)=2014) yr2014 , max(year(fp_ndt)=2015) yr2015 table1 group number ;
now easy make tests.
select * xx yr2014+yr2015=2 , yr2011+yr2012+yr2013=0 ;
you use first query sub-query instead of creating physical table.
Comments
Post a Comment