To Lecture Notes
proc means and proc summary
Use a by clause to compute statistics for grouped data:
proc means data=drugstore;
by chain product;
The data must be sorted to use a by clause.
An alternative for computing statistics for grouped variables
is to use a class clause:
proc means data=drugstore n mean std;
class chain product;
var price;
proc summary provides output similar to proc means when the class statement
is used.
proc summary is designed for output to a dataset. Printed output
must be specifically requested.
See the ProcMeansSummary Example.
Reference: