Hello,
I have codes shown as below, I am wondering if I could simply the WHERE condition better.
proc sql;
create table lab&rr as
select studysite,caseid,PCR,H3N2,FluA,FluAH1,FluAsub1,FluAsub2
from ds3
where PCR = 1 and (H3N2 = 1 or FluA = 1 or FluAH1 =1)
and ((FluAsub2 ne 1 and FluAsub1 ne 1) or (FluAsub2 = 1 and FluAsub1 = 0) or (FluAsub2 = 0 and FluAsub1 = 1) )
order by studysite,caseid;
I feel the coding which is looking for either FluAsub1 or FluAsub2 is positive, is kind of long. I am not sure if there is a better way to write it. Thanks.
(FluAsub2 ne 1 and FluAsub1 ne 1) or (FluAsub2 = 1 and FluAsub1 = 0) or (FluAsub2 = 0 and FluAsub1 = 1)
... View more