Hi I'm having trouble with the following code- specifically the subselect statements, any ideas on how to modify this?:
PROC SQL;
CREATE TABLE WORK.QUERY_FOR_VVW_DWH_PTN AS
SELECT t1.PlayerId,
t1.FirstName,
t1.LastName,
t1.Email,
t2.EndDate,
t2.Most_Recent_Overall_Experience,
t1.AdtLifetimeRange AS AdtLifetimeRange1,
(SELECT t1.AdtLifetimeRange WHERE t2.EndDate <= intnx('month', today(), -6, 'e')) AS ADT6MoBack,
(SELECT t1.AdtLifetimeRange WHERE t2.EndDate >= intnx('month', today(), -6, 'e')) AS ADT6MoForAS,
FROM TDQT.vCXSurvey t2
INNER JOIN TDQT.vCXPlayer_SAS t1 ON (t2.PlayerId = t1.PlayerId);
WHERE t2.EndDate <'20Mar2022'd;
QUIT;
This is the error I get:
76 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, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
41 FROM TDQT.vCXSurvey t2 42 INNER JOIN TDQT.vCXPlayer_SAS t1 ON (t2.PlayerId = t1.PlayerId); NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. 43 WHERE t2.EndDate <'03/20/2022' WARNING: This SAS global statement is not supported in PROC SQL. It has been ignored. 44 QUIT; 2 The SAS System Wednesday, March 29, 2023 09:06:00 AM
45 46 47 48 %LET _CLIENTTASKLABEL=; 49 %LET _CLIENTPROCESSFLOWNAME=; 50 %LET _CLIENTPROJECTPATH=; 51 %LET _CLIENTPROJECTPATHHOST=; 52 %LET _CLIENTPROJECTNAME=; 53 %LET _SASPROGRAMFILE=; 54 %LET _SASPROGRAMFILEHOST=; 55 56 ;*';*";*/;quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time
76 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, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
41 FROM TDQT.vCXSurvey t2 42 INNER JOIN TDQT.vCXPlayer_SAS t1 ON (t2.PlayerId = t1.PlayerId); NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. 43 WHERE t2.EndDate <'03/20/2022' WARNING: This SAS global statement is not supported in PROC SQL. It has been ignored. 44 QUIT; 2 The SAS System Wednesday, March 29, 2023 09:06:00 AM
45 46 47 48 %LET _CLIENTTASKLABEL=; 49 %LET _CLIENTPROCESSFLOWNAME=; 50 %LET _CLIENTPROJECTPATH=; 51 %LET _CLIENTPROJECTPATHHOST=; 52 %LET _CLIENTPROJECTNAME=; 53 %LET _SASPROGRAMFILE=; 54 %LET _SASPROGRAMFILEHOST=; 55 56 ;*';*";*/;quit; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time
... View more