Use a DATA step IF statement to calculate EVENT-DATE.Use DATA step syntax to compute the difference between EVENT_DATE and INTERVENTION_DATE. The days before INTERVENTION_DATE begin at -1 and become smaller. The days after and including INTERVENTION_DATE begin at 1 and become larger. (This function never returns 0 for a study date.)
n = event_date - intervention_date;
if n >= 0 then
n = n + 1;
return (n);
endsub;