Hi, I'm trying to use scan function with if statement but I guess I'm doing a mistake that prevents the variable count to count the observation that has this month. I'm not getting any error in the log but I'm not getting what I want here is my code %let todaysdate= %sysfunc(today(), DDMMYY10.); %let thismonth=%scan(&todaysdate,2,"/"); data Asterias2; set Asterias1; format complete_date ddmmyy10.; if scan(complete_date,2,"/")=&thismonth then count=1; run; this is a sample of my data Obs complete_date 1 29/05/2015 2 29/05/2015 3 10/6/2015 4 2/6/2015 5 10/6/2015 6 10/6/2015 7 10/6/2015 8 10/6/2015 9 2/7/2015 10 2/7/2015 11 6/7/2015 12 3/7/2015 13 18/11/2015 14 18/11/2015 15 18/11/2015
... View more