@RW9 wrote:
Sorry, that code made me chuckle. We were just discussing how SQL seems to be taking over from Base SAS programming, and that illustrates it only too well. You have effectively hand coded a proc means, and possibly a proc transpose in one long statement. And to cap it all are using named literals for no apparent reason, or with reference to the syntax.
However, simplifying to:
proc means data=audit;
class group1;
var logat roa bus_seg...;
output out=want min= max= mean= median= stddev= / autoname;
run;
(note not sure what the var() equivalent is, perhaps one of the statos can advise), would do the same, and probably by in the high percentage times faster than your code.
VAR, variance, would be VAR in proc means.
And I had the same reaction that Proc Means or Summary may be more appropriate and certainly shorter to code.
@taygehring may also be interested to know that the statistics when using proc means/ summary will inherit labels as well.
Using: var _numeric_ ; will do the summary of ALL of the numeric variables in the data set.
Also other variable lists can be used on Class or Var that Proc SQL will not.
... View more