SAS data variable function detepart

if datepart(OffenseDate) > s_date;

 

 

data crim;
set abc.crim_history;
format new_date MMDDYY10.;
format s_date MMDDYY10.;
new_date=datepart(OffenseDate);
s_date=mdy(1,1,2019);
instruction="Drop ";
if new_date > s_date then instruction="Keep";
*if datepart(OffenseDate) > s_date;
run;

Leave a Reply