I am working on the below sql and sub-sql statement:
PROC SQL;
CREATE TABLE JR.PEAK AS SELECT s.USUBJID FROM JR.SV_SRC s WHERE s.SVSTDTC NE "" AND s.SVPENRFN=2 ;
CREATE TABLE JR.SV_SRC_STEP1 AS SELECT SV.* , ( SELECT ( CASE WHEN SV.USUBJID IN (SELECT p.USUBJID FROM JR.PEAK p) THEN "Y" ELSE "N" END ) ) AS P_2 FROM JR.SV SV ; QUIT;
It gives me the below error msg:
270 CREATE TABLE JR.SV_SRC_STEP1 AS 271 SELECT SV.* 272 , ( SELECT ( CASE WHEN SV.USUBJID IN (SELECT p.USUBJID FROM JR.PEAK p) THEN "Y" ELSE "N" END ) ) AS PERIOD2 _ 22 76 272 ! LABEL="Assigned to Period 2 (Y/N)" ERROR 22-322: Syntax error, expecting one of the following: a quoted string, !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, AS, BETWEEN, CONTAINS, EQ, EQT, FORMAT, FROM, GE, GET, GT, GTT, IN, INFORMAT, INTO, IS, LABEL, LE, LEN, LENGTH, LET, LIKE, LT, LTT, NE, NET, NOT, NOTIN, OR, TRANSCODE, ^, ^=, |, ||, ~, ~=.
Any help or suggestions will be appreciated!
... View more