Thank you for using a SAS supplied data set we can run code.
Tabulate does not do sums of different variables. You would need Proc report for that .
proc report data=sashelp.class;
column sex age height tot totpct ;
define sex /group;
define age / sum;
define height/ sum;
define tot /Computed "Total";
define totpct/Computed format=percent8.1;
compute tot;
tot = age.sum +height.sum;
endcomp;
compute totpct;
totpct = age.sum/(age.sum+height.sum);
endcomp;
rbreak after/summarize;
run;
Or use proc summary to summarize the age and height by sex in a data step first and precalculate the row summaries. Note that Proc summary will provide an overall summary.
proc summary data=sashelp.class;
class sex;
var age height;
output out=work.summary sum=;
run;
The _type_ variable in the output data indicates which combinations of the class variables appear. You could use this in a data step to calculate the sum of age and height plus the desired percent for each row.
Then use Proc Print to display the result.
... View more