The OPTMODEL Procedure |
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 6.10 shows the names of the available suffixes.
Table 6.10: Suffix NamesName 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 |
Objective | .sol | No | current objective value |
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 |
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 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 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 8, "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.
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, 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 6.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 Output 6.50.
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;
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 © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.