SAS procedure SUMMARY is a quick method of converting your detail table to a fully summarized one.
Included is a sample. The key option to set is the NWAY - this generates the lowest level of summary for use in the OLAP cube.
Essentially - the class statement contains all the levels used in the various dimensions, the var statement lists all the variables analyzed, and the output statement lists the statistics and new variable names. Other statistics are available - reference the proc MEANS documentation for other output statement options.
proc summary data=sashelp.shoes nway;
class region subsidiary product;
var sales returns;
output out=new sum(sales)=sales_sum max(sales)=sales_max max(returns)=returns_max;