Features: |
PROC TABULATE statement options: FORMAT=
|
Other features: |
FORMAT procedure |
data fundrais; length name $ 8 classrm $ 1; input @1 team $ @8 classrm $ @10 name $ @19 pencils @23 tablets; sales=pencils + tablets; datalines; BLUE A ANN 4 8 RED A MARY 5 10 GREEN A JOHN 6 4 RED A BOB 2 3 BLUE B FRED 6 8 GREEN B LOUISE 12 2 BLUE B ANNETTE . 9 RED B HENRY 8 10 GREEN A ANDREW 3 5 RED A SAMUEL 12 10 BLUE A LINDA 7 12 GREEN A SARA 4 . BLUE B MARTIN 9 13 RED B MATTHEW 7 6 GREEN B BETH 15 10 RED B LAURA 4 3 ;
proc format; picture pctfmt low-high='009 %'; run;
title "Fundraiser Sales";
proc tabulate format=7.;
class team classrm;
var sales;
table (team all),
classrm='Classroom'*sales=' '*(sum colpctsum*f=pctfmt9. rowpctsum*f=pctfmt9. reppctsum*f=pctfmt9.) all*sales*sum=' '
/rts=20; run;
data fundrais; length name $ 8 classrm $ 1; input @1 team $ @8 classrm $ @10 name $ @19 pencils @23 tablets; sales=pencils + tablets; datalines; BLUE A ANN 4 8 RED A MARY 5 10 GREEN A JOHN 6 4 RED A BOB 2 3 BLUE B FRED 6 8 GREEN B LOUISE 12 2 BLUE B ANNETTE . 9 RED B HENRY 8 10 GREEN A ANDREW 3 5 RED A SAMUEL 12 10 BLUE A LINDA 7 12 GREEN A SARA 4 . BLUE B MARTIN 9 13 RED B MATTHEW 7 6 GREEN B BETH 15 10 RED B LAURA 4 3 ;
sales
) with a blank
label. Nested within each column are columns that summarize sales
for the class. The first nested column, labeled sum
,
is the sum of sales for the row for the classroom. The second nested
column, labeled ColPctSum
, is the percentage
of the sum of sales for the row for the classroom in relation to the
sum of sales for all teams in the classroom. The third nested column,
labeled RowPctSum
, is the percentage of the
sum of sales for the row for the classroom in relation to the sum
of sales for the row for all classrooms. The fourth nested column,
labeled RepPctSum
, is the percentage of the
sum of sales for the row for the classroom in relation to the sum
of sales for all teams for all classrooms. The last column of the
report summarizes sales for the row for all classrooms.classrm='Classroom'*sales=' '*(sum colpctsum*f=pctfmt9. rowpctsum*f=pctfmt9. reppctsum*f=pctfmt9.) all*sales*sum=' '