I have DATE as character variable (length 9) in the dataset "now_char" and the DATE column has dates like :- 22JAN2010 . I use the code:--
if DATE LT "07JAN2010" THEN
Week = "Week1";
ELSE IF DATE GT "07/01/08" AND DATE <="15/01Jan/08" THEN
Week = "Week2";
NOTE: Character values have been converted to numeric values at the places given by: (Line)Column).
760:16 762:21 762:43
NOTE: Invalid numeric data, '27JAN2008' , at line 760 column 16.
NOTE: Invalid numeric data, '26/01/08' , at line 762 column 21.
NOTE: Invalid numeric data, '31/01Jan/08' , at line 762 column 43.
When comparing date values then use numeric values/variables. So you will have to transform the variable to e.g. date_num. As for the date constants look up - well - "date constants" in the online documentation.
Suggested search terms: input function, date constants.