options ps=60 ls=80 pageno=1 formdlim='_';

data coal;
input location $ sulfur @@;
datalines;
A 15.2 A 16.8 A 17.5 A 16.2
B 13.1 B 13.8 B 12.6 B 12.9
C 17.5 C 17.1 C 16.7 C 16.5
D 18.3 D 18.4 D 18.6 D 17.9
E 12.8 E 13.6 E 14.2 E 14.0
F 13.5 F 13.9 F 13.6 F 14.1
;

/* The random statement below tells SAS which factors are random (there is
only one here!). */

proc glm;
class location;
model sulfur=location;
random location;
run;

/* The varcomp procedure gives us variance component estimates. */

proc varcomp method=type1;
class location;
model sulfur=location;
run;

/* This gives us the overall mean of the response (for Example 12.4). */

proc means;
run;