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 6.10 shows the names of the available suffixes.

Table 6.10: Suffix Names
Name Kind Suffix Modifiable Description
Variable.initNoinitial value for the solver
Variable.lbYeslower bound
Variable.ubYesupper bound
Variable.solNocurrent solution value
Variable.rcNoreduced cost (LP) / gradient of Lagrangian function
Variable.dualNoreduced cost (LP) / gradient of Lagrangian function
Variable.relaxYesrelaxation of integrality restriction
Variable.priorityYesbranching priority
Variable.directionYesbranching direction
Variable.statusYesstatus information from solver
Objective.solNocurrent objective value
Constraint.bodyNocurrent constraint body value
Constraint.dualNodual value from the solver
Constraint.lbYescurrent lower bound
Constraint.ubYescurrent upper bound
Constraint.statusYesstatus 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;
 


The OPTMODEL Procedure

x.LB x.UB x.INIT x.SOL
-1.7977E308 1.79769E308 0 0

y.LB y.UB y.INIT y.SOL
-1.7977E308 1.79769E308 0 0

c.LB c.UB c.BODY c.DUAL
-1.7977E308 3 0 0


Figure 6.50: Using a Suffix: Retrieving Auxiliary Values

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

         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;
 


The OPTMODEL Procedure

x.LB x.UB x.INIT x.SOL
0 1.79769E308 0 0

y.LB y.UB y.INIT y.SOL
0 1.79769E308 0 0.5

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


Figure 6.51: Using a Suffix: Modifying Auxiliary Values

CAUTION: Spaces are significant. The form {\hv name.\textvisiblespace tag} is treated as a SAS format name followed by the tag name, not as a suffixed identifier. The forms {\hv name.tag}, {\hv name\textvisiblespace.\textvisiblespace tag}, and {\hv name\textvisiblespace.tag} (note the location of spaces) are interpreted as suffixed references.

Previous Page | Next Page | Top of Page