BookmarkSubscribeRSS Feed
Dunne
Obsidian | Level 7

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.

 

Iddx1dx2dx3dx4
11210999
21011813
399910  
413145
5912 13

 

 

and I want the result looks like this

 

id dx
11
28
310
41
59

 

Thank you,

1 REPLY 1
Astounding
PROC Star

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;