I'm getting an error (the parentheses seem fine now):
23 proc sql;
24 create table condition as
25 select
26 id,
27 pid,
28 dxCode as icd,
29 dxCodeDescription,
30 dxSeqNo,
31 case when (compress(icd,".") in (&asthma_suff)) then 'ASTHMA'
NOTE: Line generated by the macro variable "ASTHMA_SUFF".
31 ('J4520','J4521','J4522','J4530','J4531','J4532','J4540','J4541','J4542','J4550','J4551','J4552','J45901','J45902','J4590
_______
_
79
22
76
31 ! 9','J45990','J45991','J45998')
ERROR 79-322: Expecting a SELECT.
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.
32 when (compress(icd,".") in (&asthma_rel)) then 'ASTHMA'
33 when (compress(icd,".") in (&cad_suff)) then 'CAD'
34 when (compress(icd,".") in (&cad_rel)) then 'CAD'
35 when (compress(icd,".") in (&chf_suff) then 'CHF'
36 when (compress(icd,".") in (&chf_rel)) then 'CHF'
37 when (compress(icd,".") in (&copd_suff) then 'COPD'
38 when (compress(icd,".") in (&copd_rel)) then 'COPD'
39 when (compress(icd,".") in (&diab_suff)) then 'DIABETES'
40 when (compress(icd,".") in (&diab_rel)) then 'DIABETES'
2 The SAS System 20:52 Wednesday, June 29, 2022
41 else 'HTN'
42 end as Condition
43 from dxtable
44 order by id;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
45 quit;
... View more