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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.