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).
Table 8.10 shows the names of the available suffixes.
Name Kind |
Suffix |
Modifiable |
Description |
Variable |
.init |
No |
Initial value for the solver |
Variable |
.lb |
Yes |
Lower bound |
Variable |
.ub |
Yes |
Upper bound |
Variable |
.sol |
No |
Current solution value |
Variable |
.rc |
No |
Reduced cost (LP) / gradient of Lagrangian function |
Variable |
.dual |
No |
Reduced cost (LP) / gradient of Lagrangian function |
Variable |
.relax |
Yes |
Relaxation of integrality restriction |
Variable |
.priority |
Yes |
Branching priority |
Variable |
.direction |
Yes |
Branching direction |
Variable |
.status |
Yes |
Status information from solver |
Variable |
.label |
Yes |
Label text for the solver |
Objective |
.sol |
No |
Current objective value |
Objective |
.label |
Yes |
Label text for the solver |
Constraint |
.body |
No |
Current constraint body value |
Constraint |
.dual |
No |
Dual value from the solver |
Constraint |
.lb |
Yes |
Current lower bound |
Constraint |
.ub |
Yes |
Current upper bound |
Constraint |
.status |
Yes |
Status information from solver |
Constraint |
.label |
Yes |
Label text for the solver |
Implicit Variable |
.sol |
No |
Current solution value |
Problem |
.label |
Yes |
Label text for the solver |
any |
.name |
No |
Name text for any non-dummy symbol |
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 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 10, 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 will reject invalid status characters. Blank or empty strings are treated as new row or column entries for the purpose of "warm starting" the solver.
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.
You must use suffixes with names of the appropriate kind. For example, the .init suffix cannot be used with the name of an objective. In particular, local dummy parameter names cannot have suffixes.
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 8.10 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 code formulates 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 8.51.
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;
Next, continue to submit the following statements to change the default bounds and solve again. The output is shown in Figure 8.52.
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;
Caution:Spaces are significant. The form is treated as a SAS format name followed by the tag name, not as a suffixed identifier. The forms , , and (note the location of spaces) are interpreted as suffixed references.
Copyright © SAS Institute, Inc. All Rights Reserved.