I'm trying to use Proc SQL and a case-statement to test for a condition and add an index. However, I cannot get the case
-where
statement to work even though the syntax seems to match the examples I've seen. Using the code below I get the following error:
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant, a missing value, (, +, -, BTRIM, CALCULATED, CASE, EXISTS, INPUT, NOT, PUT, SELECT, SUBSTRING, TRANSLATE, USER, WHEN, ^, ~.
Proc SQL;
Create table table_ix AS
Select t1.*,
Case
Where UPCASE(t2.test) Contains UPCASE(TRIM(t2.key)) Then 1
Else 0
end as index
From Table1 AS t1, Table2 AS t2;
QUIT;
From what can see in Help, my statement matches the examples. This is probably simple to solve and a minor overlook on my part, but I cannot get it to work (for instance, I've tried matching a single string to see if the reference to a separate table is the issue, e.g. ...Contains UPCASE("Teststring")
....
Any suggestions?