Hello team,
I need to use or statement in a case statement. It keeps giving me errors:
Proc sql; create table mytable as; select a.*, b* , case when (a.diagcode1 <150 and a.diagcode2 <12) then 'no more' case when missing(a.diagcode) or missing(a.diacode2) then 'non existent' else ' ' end as 'new stata' from a Left join b...
what is the problem?
Regards
blueblue
Try this - but please remember to post your SAS log including errors as we aren't mind readers 😉
Proc sql;
create table mytable as
select a.*, b* ,
case
when (a.diagcode1 <150 and a.diagcode2 <12) then 'no more'
when missing(a.diagcode) or missing(a.diacode2) then 'non existent'
else ' '
end as new_stata
from a Left join b...
Also
as 'new stata'
should be
as 'new strata'n
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.