So i'm back with a similar question. Actually it's two parts. One, here is my code and here is the error message Proc SQL; create table zerosuicidegrant as select distinct *, FROM suicidegrant_stratified _______________________ 22 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. where substr(Diag_1, 1, 3) in ('X40','X41','X42','X44','X46','X47','Y10','Y11','Y12','Y16','Y17','T39', 'T40', 'T43', 'T58') OR substr(Diag_1,1,4) in ('Y870','T423', 'T424', 'T427', 'T509') OR substr(Diag_1, 1,3) BETWEEN 'X60' AND 'X84' OR Diag_1 = 'T1491'; quit; Proc SQL;
create table zerosuicidegrant as
select distinct *,
FROM suicidegrant_stratified
where substr(Diag_1, 1, 3) in ('X40','X41','X42','X44','X46','X47','Y10','Y11','Y12','Y16','Y17','T39', 'T40', 'T43', 'T58')
OR substr(Diag_1,1,4) in ('Y870','T423', 'T424', 'T427', 'T509')
OR substr(Diag_1, 1,3) BETWEEN 'X60' AND 'X84'
OR Diag_1 = 'T1491';
quit; _______________________ 22 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. Also, how do I remove duplicates? THANK YOU all for your help! I'm still a novice, but I want to get better.
... View more