The GLIMMIX Procedure

Programming Statements

This section lists the programming statements available in PROC GLIMMIX to compute various aspects of the generalized linear mixed model or output quantities. For example, you can compute model effects, weights, frequency, subject, group, and other variables. You can use programming statements to define the mean and variance functions. This section also documents the differences between programming statements in PROC GLIMMIX and programming statements in the SAS DATA step. The syntax of programming statements used in PROC GLIMMIX is identical to that used in the NLMIXED procedure (see Chapter 63, The NLMIXED Procedure, of the SAS/STAT User’s Guide) and the MODEL procedure (see the SAS/ETS User’s Guide). Most of the programming statements that can be used in the DATA step can also be used in the GLIMMIX procedure. Refer to SAS Language Reference: Dictionary for a description of SAS programming statements. The following are valid statements:


CALL name [ ( expression [, expression ...] ) ];


DO [ variable = expression

[TO expression] [BY expression]

[, expression [ TO expression] [ BY expression ] ...]


[ WHILE expression ] [ UNTIL expression ];


GOTO statement_label;

IF expression;

IF expression THEN program_statement;

ELSE program_statement;

variable = expression;

variable + expression;

LINK statement_label;

PUT [ variable] [=] [...];


SELECT[(expression )];


SUBSTR( variable, index, length )= expression;

WHEN (expression) program_statement;

OTHERWISE program_statement;

For the most part, the SAS programming statements work the same as they do in the SAS DATA step, as documented in SAS Language Reference: Concepts. However, there are several differences:

  • The ABORT statement does not allow any arguments.

  • The DO statement does not allow a character index variable. Thus

    do i = 1,2,3; 

    is supported; however, the following statement is not supported:

    do i = 'A','B','C';

  • The LAG function is not supported with PROC GLIMMIX.

  • The PUT statement, used mostly for program debugging in PROC GLIMMIX, supports only some of the features of the DATA step PUT statement, and it has some features not available with the DATA step PUT statement:

    • The PROC GLIMMIX PUT statement does not support line pointers, factored lists, iteration factors, overprinting, _INFILE_, the colon (:) format modifier, or "$".

    • The PROC GLIMMIX PUT statement does support expressions, but the expression must be enclosed in parentheses. For example, the following statement displays the square root of x:

      put (sqrt(x));
    • The PROC GLIMMIX PUT statement supports the item _PDV_ to display a formatted listing of all variables in the program. For example:

      put _pdv_;
  • The WHEN and OTHERWISE statements enable you to specify more than one target statement. That is, DO/END groups are not necessary for multiple statement WHENs. For example, the following syntax is valid:

       when (exp1) stmt1; 
       when (exp2) stmt3;

The LINK statement is used in a program to jump immediately to the label statement_label and to continue program execution at that point. It is not used to specify a user-defined link function.

When coding your programming statements, you should avoid defining variables that begin with an underscore (_), because they might conflict with internal variables created by PROC GLIMMIX.