Hello I am trying to compare 2 dates using arrays and create a counter when the dates are within 30 days of each other. It does not seem to work. Attached is my SAS dataset and below is my code:
data master_utp_3;
set sas.master_utp2;
by luid;
if first.luid then do;
*-- Array for TRANS DATE to compare against impressions and clicks for time difference --*;
array trans_dt {*} trans_event_dt;
*-- Array for DISPLAY DATE to compare against impressions and clicks for time difference --*;
array dis_dt [*] display_imps_event_dt;
end;
*-- Checking to ensure the impression or click was 30-days prior to the transaction --*;
do i=1 to dim(trans_dt) until(_check_pre_trans_display>0);
_check_pre_trans_display = (intck('day',display_imps_event_dt,trans_dt(i)))<=30
and
(intck('day',display_imps_event_dt,trans_dt(i)))>=0;
end;
if _check_pre_trans_display>=1 then do;
pre_display_imps+1;
end;
run;
... View more