01-04-2013 03:42 AM
I received an query from user as below.
Create table test1 as
over (partition by system, id, key, cd)as cnt
When running the query user is getting an error
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
Is this because of the "over partition by system"?
01-04-2013 03:00 PM
OVER is a feature of SQL 2003 that SAS hasn't implemented at this point, that allows for "Determining the partitioning and ordering of a rowset before the associated window function is applied." (I've never used it myself).
You'll have to either restructure your query for SAS, or, if your query is to an exernal database, use pass-through to pass the OVER clause to the database.