Case when嵌套使用
proc sql;
create table ep1 as
select * from tmp4(drop=epoch) inner join se on tmp4.usubjid=se.pt and
case when tmp4.visit^='基线/随机化(第0天)' then
case when se.taetord in (1 2) then
se.sestdtc<=tmp4.dsstdtc
else
se.sestdtc<tmp4.dsstdtc
end
when tmp4.visit='基线/随机化(第0天)' then
case when se.taetord in (1 2) then
substr(se.sestdtc,1,10)<=tmp4.dsstdtc
else
substr(se.sestdtc,1,10)<tmp4.dsstdtc
end
end;
quit;