Hi, I am looking at the SAS CSV USA-TSA Claim Data and I am getting this error: I am asked to create a column called Date_Issues where I track if there is an incorrect or unexpected formatting of the dates. It says that I should flag the date issues if either of the two date columns, Incident_Date or Date_Received, are outside the date range 2002-2017, or if Incident_Date>Date_Received. However, I am getting this error message when I do the inequality test: 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
68
69 data work.tsa_adjust;
70 set work.tsa_claims;
71 format Date_Received Incident_Date date9.;
72 length Claim_Site Claim_Type Disposition $ 100;
WARNING: Length of character variable Claim_Site has already been set.
Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of a character variable.
WARNING: Length of character variable Claim_Type has already been set.
Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of a character variable.
WARNING: Length of character variable Disposition has already been set.
Use the LENGTH statement as the very first statement in the DATA STEP to declare the length of a character variable.
73 if (Claim_Site in('-' '') or Claim_Site=.) then Claim_Site='Unknown';
74 if (Disposition in('-' '') or Disposition=.) then Disposition='Unknown';
75 if (Claim_Type in('-' '') or Claim_Type=.) then Claim_Type='Unknown';
76 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.
77 then Date_Issues='Needs Review';
78 if (Date_Received=.) or (Date_Received<'01JAN2002'd or Date_Received>'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.
79 then Date_Issues='Needs Review';
80 if (Incident_Date>Date_Received) then Date_Issues='Needs Review';
... View more