This PROC TABULATE step produces two output objects: one for each BY group. Because the HTML destination is open, ODS writes the output to the body file. At the same time, because the Output destination is open and because a data set name is associated with each output object, ODS creates an output data set from each BY group.
proc tabulate data=energy format=dollar12.;
   by region;
   class division type;
   var expenditures;
   table division,
         type*expenditures;

   format region regfmt. division divfmt. type usetype.;
   title 'Energy Expenditures for Each Region';
   title2 '(millions of dollars)';
run;