Your code "gives" nothing, because it is invalid syntax:
75 if date='24Dec2016'
76 date='05Dec2013'
____
22
77 date='24Dec2017'
____
22
78 date='24Dec2014'
____
22
79 date='24Dec2015'
____
22
80 date='24Dec2019'
____
22
81 date='24Dec2018'
____
22
82 date='24Sep2012'
____
22
83 date='06Jul2015'
____
22
ERROR 22-322: Syntaxfehler, erwartet wird eines der folgenden: !, !!, &, *, **, +, -, /, ;, <, <=, <>, =, >, ><, >=, AND, EQ, GE,
GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, ^=, |, ||, ~=.
84 then doutlier1=1; else doutlier1=0;
If you actually have code that runs without ERRORs, post that.
To check if a date is in a given set of dates, use the IN operator:
data test;
input date yymmdd10.;
format date yymmddd10.;
if date in ('01jan2020'd,'08apr2020'd)
then doutlier = 1;
else doutlier = 0;
datalines;
2020-01-01
2020-01-02
2020-04-08
2020-04-09
;