我在proc SQL中有以下代码,我想将case语句移至数据步骤。
Proc SQL;
select
Xas,
Yas,
case when missing(prj_role_desc) eq 1 then 'Unknown' else prj_role_desc end as prj_role_desc,
case when job_descr eq 'X' or project_status in ('Open', 'Filled', 'Pending') then 'TB'end as tb_status
from employee;
quit;
答案 0 :(得分:1)
您有两个case语句。
data pies;
set employee;
if missing(prj_role_desc) then prj_role_desc='Unknown';
if job_descr eq 'X' or project_status in ('Open', 'Filled', 'Pending')
then tb_status='TB'
keep Xas Yas prj_role_desc tb_status;
run;