Hello,
Could anyone help me with? I want if any dx1-dx4 <=9 the generate a variate dx with the smallest dx (ex id=4 the smallest dx <-9 is of dx2). If all dx1-dx4 >9 then take the value of the smallest dx but not the value of 999.
and I want the result looks like this
Thank you,
Why should ID 5 generate 9, and not 1?
Except for that, a short program would do:
data want;
set have;
dx = min(of dx1-dx4);
if dx=999 then dx=.;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Latest Updates
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.