The OPTMODEL Procedure

Suffixes

Use suffixes with identifier-expressions to retrieve and modify various auxiliary values maintained by the solver. The values of the suffixes can come from expressions in the declaration of the name that is suffixed. For example, the following declaration of variable v provides the values of several suffixes of v at the same time:

   var v >= 0 <= 2 init 1;

The values of the suffixes also come from the solver or from values assigned by assignment or READ DATA statements (see an example in the section Data Set Input/Output).

You must use suffixes with names of the appropriate type. For example, the .init suffix cannot be used with the name of an objective. In particular, local dummy parameter names cannot have suffixes.

Table 5.14 shows the names of the available suffixes.

Table 5.14: Suffix Names

Name Kind

Suffix

Modifiable

Description

any

.name

No

Name text for any non-dummy symbol

Constraint

.active

No

Active status in current problem

Constraint

.block

Yes

Block ID for decomposition

Constraint

.body

No

Current constraint body value

Constraint

.dual

No

Dual value from the solver

Constraint

.label

Yes

Label text for the solver

Constraint

.lb

Yes

Current lower bound

Constraint

.status

Yes

Status information from solver

Constraint

.ub

Yes

Current upper bound

Implicit Variable

.sol

No

Current solution value

Objective

.active

No

Active status in current problem

Objective

.sol

No

Current objective value

Objective

.label

Yes

Label text for the solver

Problem

.active

No

Active status of problem

Problem

.label

Yes

Label text for the solver

Variable

.active

No

Active status in current problem

Variable

.direction

Yes

Branching direction for MILP

Variable

.dual

No

Alias for .rc

Variable

.fixed

No

Fixed status

Variable

.init

No

Initial value for the solver

Variable

.label

Yes

Label text for the solver

Variable

.lb

Yes

Lower bound

Variable

.msinit

No

Numeric value at the best starting point reported by multistart solver

Variable

.priority

Yes

Branching priority for MILP

Variable

.rc

No

Reduced cost (LP) or gradient of Lagrangian function

Variable

.relax

Yes

Relaxation of integrality restriction

Variable

.sol

No

Current solution value

Variable

.status

Yes

Status information from solver

Variable

.ub

Yes

Upper bound


Note: The .init value of a variable represents the value it had before the most recent SOLVE statement that used the variable. The value is zero before a successful completion of a SOLVE statement that uses the variable.

The .sol suffix for a variable, implicit variable, or objective can be used within a declaration to reference the current value of the symbol. It is treated as a constant in such cases. When processing a SOLVE statement, the value is fixed at the start of the SOLVE. Outside of declarations, a variable, implicit variable, or objective name with the .sol suffix is equivalent to the unsuffixed name.

The .status suffix reports status information from the solver. Currently, only the LP solver provides status information. The .status suffix takes on the same character values that are found in the _STATUS_ variable of the PRIMALOUT and DUALOUT data sets for the OPTLP procedure, including values set by the IIS= option. See the section Variable and Constraint Status and the section Irreducible Infeasible Set, both in Chapter 6: The Linear Programming Solver, for more information. For other solvers, the .status values default to a single blank character.

If you choose to modify the .status suffix for a variable or constraint, the assigned suffix value can be a single character or an empty string. The LP solver rejects invalid status characters. Blank or empty strings are treated as new row or column entries for the purpose of warm starting the solver.

The .active suffix reports the current activity status for names in the problem. The value is 1 if the element is active or 0 otherwise. A PROBLEM name is considered active if it is the current problem (that is, it was selected by the most recent USE PROBLEM statement). A constraint is considered active if it is included in the current problem and not dropped. An objective is considered active if it is the selected objective for the current problem. A variable is considered active if it is included in the current problem, independent of the fixed status.

The .fixed suffix reports the fixed status of a variable. The value is 1 if the variable is fixed using the FIX statement for the current problem or 0 otherwise. Variables that are not included in the current problem are treated as unfixed.

The .msinit suffix reports the numeric value of a variable at the best starting point, as reported by the NLP solver when the MULTISTART option is specified. If the solver does not report a best starting point, then the value is missing. The value is tracked independently for each problem to support multiple subproblems. See the section Multistart in Chapter 9: The Nonlinear Programming Solver, for more information.

The .block suffix identifies the subproblem for constraints when used with the METHOD=USER option of the decomposition algorithm. The value must be numeric and is initially assigned a missing value. A constraint with a missing value for the .block suffix is part of the master problem. Otherwise constraints belong to the same subproblem if and only if they have the same .block suffix values. See Chapter 14: The Decomposition Algorithm, for more information.

The .label suffix represents the text passed to the solver to identify a variable, constraint, or objective. Some solvers can display this label in their output. The maximum text length passed to the solver is controlled by the MAXLABLEN= option. The default text is based on the name in the model, abbreviated to fit within MAXLABLEN. For example, a model variable x[1] would be labeled x[1]. This label text can be reassigned. The .label suffix value is also used to create MPS labels stored in the output data set for the SAVE MPS and SAVE QPS statements.

The .name suffix represents the name of a symbol as a text string. The .name suffix can be used with any declared name except for local dummy parameters. This suffix is primarily useful when applied to problem symbols (see the section Problem Symbols), since the .name suffix returns the name of the referenced symbol, not the problem symbol name. The name text is based on the name in the model, abbreviated to fit in 256 characters.

Suffixed names can be used wherever a parameter name is accepted, provided only the value is required. However, you are not allowed to change the value of certain suffixes. Table 5.14 marks these suffixes as not modifiable. Suffixed names that are used as a target in an assignment or READ DATA statement must be modifiable.

The following statements formulate a trivial linear programming problem. The objective value is unbounded, which is reported after the execution of the SOLVE statement. The PRINT statements illustrate the corresponding default auxiliary values. This is shown in Figure 5.56.

proc optmodel;
     var x, y;
     min z = x + y;
     con c: x + 2*y <= 3;
     solve;
     print x.lb x.ub x.init x.sol;
     print y.lb y.ub y.init y.sol;
     print c.lb c.ub c.body c.dual;

Figure 5.56: Using a Suffix: Retrieving Auxiliary Values

x.LB x.UB x.INIT x.SOL
-1.7977E+308 1.7977E+308 0 0

y.LB y.UB y.INIT y.SOL
-1.7977E+308 1.7977E+308 0 0

c.LB c.UB c.BODY c.DUAL
-1.7977E+308 3 0 .


Next, continue to submit the following statements to change the default bounds and solve again. The output is shown in Figure 5.57.

     x.lb=0;
     y.lb=0;
     c.lb=1;
     solve;
     print x.lb x.ub x.init x.sol;
     print y.lb y.ub y.init y.sol;
     print c.lb c.ub c.body c.dual;

Figure 5.57: Using a Suffix: Modifying Auxiliary Values

x.LB x.UB x.INIT x.SOL
0 1.7977E+308 0 0

y.LB y.UB y.INIT y.SOL
0 1.7977E+308 0 0.5

c.LB c.UB c.BODY c.DUAL
1 3 1 0.5


Note: Spaces are significant. The form NAME. TAG is treated as a SAS format name followed by the tag name, not as a suffixed identifier. The forms NAME.TAG, NAME . TAG, and NAME .TAG (note the location of spaces) are interpreted as suffixed references.