Can we use case when or where condition if we join multiple datasets using proc sql.
proc sql;
create table x_01 as
select a.*,
b.TDC_RAW as DTC_A,
c.TDC_RAW as DTC_B,
case when NDC_RAW ne "" d.NDC_RAW as DC_A,
e.NDC_RAW as DC_B
from rs a left join _dat b on a.ent=b.ect
left join dat_b c on a.ent=c.ect
left join dat d on a.ent=d.ect
left join dat_b e on a.ent=e.ect
quit;
in the above code i am using case just to filter non missing from one of the dataset but it gives error
-
22
76
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, -, /, <, <=,
<>, =, >, >=, AND, EQ, EQT, GE, GET, GT, GTT, LE, LET, LT, LTT, NE, NET, OR,
THEN, ^=, |, ||, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
Any help if we can use where/case condition while joining multiple datasets