# Example 1: Specifying the Sum Statistic in a Block Chart

 Features: BLOCK statement option SUMVAR= Other features: FORMAT statement and the GOPTIONS statement option BORDER Sample library member: GCHBKSUM
This example produces a block chart of total sales for three sites by charting the values of the character variable SITE and calculating the sum of the variable SALES for each site. It prints formatted values of the sales statistics below the blocks.
All the blocks use the same pattern because by default patterns change for subgroups and in this example subgroups are not specified.

## Program

`goptions reset=all border;`
```data totals;
length dept \$ 7 site \$ 8;
input dept site quarter sales;
datalines;
Parts Sydney 1 7043.97
Parts Atlanta 1 8225.26
Parts Paris 1 5543.97
Tools Sydney 4 1775.74
Tools Atlanta 4 3424.19
Tools Paris 4 6914.25
;```
`title "Total Sales";`
```proc gchart data=totals;
format sales dollar8.;
block site / sumvar=sales;
run;
quit;```

## Program Description

Set the graphics environment. The BORDER option in the GOPTIONS statement draws a black border around the graph.
`goptions reset=all border;`
Create data set TOTALS. TOTALS contains quarterly sales data for three manufacturing sites for one year. Sales figures are broken down by department.
```data totals;
length dept \$ 7 site \$ 8;
input dept site quarter sales;
datalines;
Parts Sydney 1 7043.97
Parts Atlanta 1 8225.26
Parts Paris 1 5543.97
Tools Sydney 4 1775.74
Tools Atlanta 4 3424.19
Tools Paris 4 6914.25
;```
Define title.This title appears on the chart.
`title "Total Sales";`
Produce the block chart. The BLOCK statement produces a block chart. SUMVAR= calculates the sum of SALES for each value of the chart variable SITE. With SUMVAR= the default statistic is SUM. The variable SALES is assigned a dollar format.
```proc gchart data=totals;
format sales dollar8.;
block site / sumvar=sales;
run;
quit;```