*;
* The output from the following two procs will be in a single worksheet
* with a user-specified name of 'Canada'.
*;
proc tabulate data=prdsale;
where country eq 'CANADA' and year eq 1993;
var predict actual;
class region division prodtype;
table
region*(division*prodtype all={label='Division Total'}) all={label='Grand Total'},
predict={label='Total Predicted Sales'}*f=dollar10.*sum={label=''}
actual={label='Total Actual Sales'}*f=dollar10.*sum={label=''};
run; quit;
proc print data=prdsale noobs label split='*';
where country eq 'CANADA' and year eq 1993;
id country region division;
var prodtype product quarter month year;
sum predict / style={tagattr='format:Currency'};
sum actual / style={tagattr='format:Currency'};
sum difference / style={tagattr='format:Currency formula:RC[-1]-RC[-2]'};
label prodtype = 'Product*Type'
predict = 'Predicted*Sales'
actual = 'Actual*Sales';
run; quit;