You can invoke BY-group processing in both DATA steps
and PROC steps by using a BY statement. For example, the following
DATA step program uses the SET statement to combine observations from
three SAS data sets by interleaving the files. The BY statement shows
how the data is ordered.
data all_sales;
set region1 region2 region3;
by State City Zip;
… more SAS statements …
run;