Just update it to reflect your logic:
data want;
set have;
select (dlpp1);
when (1) hb_dlpp1=0;
when (2) hb_dlpp1=1;
when (-99) do;
if pdet=1 then hbdlpp1=1; if pdet=2 then hpdlpp1=0; if pdet=. then hdlpp1=.; if pdet=-99 then hldpp1=-99;
end;
otherwise hb_dlpp1=.;
end;
run;
... View more