The join will produce duplicates, if date intervals in the second dataset overlap. On the other hand, if you decide not to include detailed information from this second table, you can aggregate the result of join: proc sql; create table test as select a.id , a.transaction_date , a.group , max(b.group is not missing) as flag from transaction_table a left outer join period_table b on a.transaction_date between b.period_start and b.period_end and a.group = b.group group by 1,2,3 quit;
... View more