Can anyone teach me how to rewrite the following command more efficiently. Basically, I want to execute multiple operations if a certain condition is satisfied.
data a;
set a;
if var1 > 5 then var2 = 5;
if var1 > 5 then var3 = 5;
if var1 > 5 then var4 = var1;
run;
I know I can rewrite it as the following. But is there any more efficient way to do this.
Data a;
set a;
if var> 5 then do;
var2 = 5; var3= 5; var4 = var1;
end;
run;