Solution: Proc sql;
create table test2.withinyear AS
select *
from test2.allyears
group by case_concept_name
having sum(event_time_timestamp < "01JAN18:00:00:00"dt or event_time_timestamp > "31DEC18:23:59:59"dt) = 0
; Looks messy, but it works. All cases outside of 2018 is now not copied over to withinyear.
... View more