I am trying to use some SQL code in SAS within a proc SQL. The original code in SQL Server had this which worked fine.
case
when entry_stamp between '2011-10-29 21:00:00.000' and '2011-11-06 02:00:00.000'
then dateadd(hour, 5, cast(convert (char(16), entry_stamp, 121) as datetime))
... ... else dateadd(hour, 6, cast(convert (char(16), entry_stamp, 121) as datetime)) end ,
I get a syntax error at the brackets by the 121. A bit of googling suggests that dateadd is not supported in proc SQL?
Thanks.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, , *, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN, CONTAINS, ELSE, END, EQ, EQT, GE, GET, GT, GTT, IN, IS, LE, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, WHEN, ^, ^=, |, ||, ~, ~=.