I'm not sure I completely understand your problem... but i think this is what you're looking for... proc sql noprint; create table symptomx as select ae.pid, ae.aefdate, ae.aetdate, ae.prefcode, ae.preftext, ae.aercaus, ae.aecaus, a.colldate, a.factdat, a.lactdat, a.cpevent, a.visit from ae left join drugs a on ae.pid = a.pid where ae.aefdate le a.colldate and a.colldate le ae.aetdate and ae.aetdate le a.colldate ; quit; If not, can you clarify what all these things are... perhaps tell me what AE means for context.
... View more