The following statements are available in the GLM procedure:
PROC GLM
<options> ;
CLASS
variable <(REF= option)> …<variable <(REF= option)>> </ globaloptions> ;
MODEL
dependentvariables = independenteffects </ options> ;
ABSORB
variables ;
BY
variables ;
CODE
<options> ;
FREQ
variable ;
ID
variables ;
WEIGHT
variable ;
CONTRAST
’label’ effect values <…effect values> </ options> ;
ESTIMATE
’label’ effect values <…effect values> </ options> ;
LSMEANS
effects </ options> ;
MANOVA
<testoptions> </ detailoptions> ;
MEANS
effects </ options> ;
OUTPUT
<OUT=SASdataset> keyword=names <…keyword=names> </ option> ;
RANDOM
effects </ options> ;
REPEATED
factorspecification </ options> ;
STORE
<OUT=>itemstorename </ LABEL='label'> ;
TEST
<H=effects> E=effect </ options> ;
Although there are numerous statements and options available in PROC GLM, many applications use only a few of them. Often you can find the features you need by looking at an example or by quickly scanning through this section.
To use PROC GLM, the PROC GLM and MODEL statements are required. You can specify only one MODEL statement (in contrast to the REG procedure, for example, which allows several MODEL statements in the same PROC REG run). If your model contains classification effects, the classification variables must be listed in a CLASS statement, and the CLASS statement must appear before the MODEL statement. In addition, if you use a CONTRAST statement in combination with a MANOVA, RANDOM, REPEATED, or TEST statement, the CONTRAST statement must be entered first in order for the contrast to be included in the MANOVA, RANDOM, REPEATED, or TEST analysis.
Table 42.2 summarizes the positional requirements for the statements in the GLM procedure.
Table 42.2: Positional Requirements for PROC GLM Statements
Statement 
Must Precede… 
Must Follow… 


First RUN statement 

First RUN statement 

MODEL statement 

MODEL statement 

or RANDOM statement 

MODEL statement 

First RUN statement 

First RUN statement 

MODEL statement 

CONTRAST or 

MODEL statement 

MODEL statement 

CLASS statement 

statement 

MODEL statement 

CONTRAST or 

MODEL statement 

or TEST statement 

MANOVA or 
MODEL statement 

REPEATED statement 

First RUN statement 
Table 42.3 summarizes the function of each statement (other than the PROC statement) in the GLM procedure.
Table 42.3: Statements in the GLM Procedure
Statement 
Description 

Absorbs classification effects in a model 

Specifies variables to define subgroups for the analysis 

Declares classification variables 

Requests that the procedure write SAS DATA step code to a file or catalog entry for computing predicted values according to the fitted model 

Constructs and tests linear functions of the parameters 

Estimates linear functions of the parameters 

Specifies a frequency variable 

Identifies observations on output 

Computes least squares (marginal) means 

Performs a multivariate analysis of variance 

Computes and optionally compares arithmetic means 

Defines the model to be fit 

Requests an output data set containing diagnostics for each observation 

Declares certain effects to be random and computes expected mean squares 

Performs multivariate and univariate repeated measures analysis of variance 

Requests that the procedure save the context and results of the statistical analysis into an item store 

Constructs tests that use the sums of squares for effects and the error term you specify 

Specifies a variable for weighting observations 
The rest of this section provides detailed syntax information for each of these statements, beginning with the PROC GLM statement. The remaining statements are covered in alphabetical order.
The STORE and CODE statements are also used by many other procedures. A summary description of functionality and syntax for these statements is also shown after the PROC GLM statement in alphabetical order, but you can find full documentation about them in the section STORE Statement of Chapter 19: Shared Concepts and Topics.