It should be flagging the extra ) in the statement and not the date literal.
46 data _null_;
47 if (Incident_Date=.) or (Incident_Date<'01JAN2002'd or Incident_Date>'31DEC2017'd))
-
22
200
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, ;, <, <=, <>,
=, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOT, NOTIN, OR, THEN,
^, ^=, |, ||, ~, ~=.
ERROR 200-322: The symbol is not recognized and will be ignored.
48 then Date_Issues='Needs Review';
49 run;
But I was able to get SAS into a state where it did flag the date literal as an error.
825 data _null_;
826 if (Incident_Date=.) or (Incident_Date<'01JAN2002'd or Incident_Date>'31DEC2017'd))
-
390
200
76
ERROR 390-185: Expecting an relational or arithmetic operator.
ERROR 200-322: The symbol is not recognized and will be ignored.
ERROR 76-322: Syntax error, statement will be ignored.
827 then Date_Issues='Needs Review';
828 run;
Not sure if it was because of some hidden character I copied from your example code or some other previous syntax errors I had made in the same SAS session.
But starting a new SAS session got it back to normal behavior.
... View more