The OPTMODEL Procedure

ODS Table and Variable Names

PROC OPTMODEL assigns a name to each table it creates. You can use these names to reference the table when you use the Output Delivery System (ODS) to select tables and create output data sets. The names of tables common to all solvers are listed in Table 6.8. Some solvers can generate additional tables; see the individual solver chapters for more information. For more information about ODS, see SAS Output Delivery System: User's Guide.

Table 6.8: ODS Tables Produced in PROC OPTMODEL
ODS Table Name Description Statement/Option
DerivMethodsList of derivatives used by the solver, including the method of computationSOLVE
OptStatisticsSolver-dependent description of the resources required for solution, including function evaluations and solver timeSOLVE
PrintTableSpecified parameter and/or variable valuesPRINT
ProblemSummaryDescription of objective, variables, and constraintsSOLVE
SolutionSummaryOverview of solution, including solver-dependent solution quality valuesSOLVE
SolverOptionsList of solver options and their valuesSOLVE

To guarantee that ODS output data sets contain information from all executed statements, use the PERSIST= option on the ODS OUTPUT statement. For details, see SAS Output Delivery System: User's Guide.

Table 6.9 lists the variable names of the preceding tables used in the ODS template of the OPTMODEL procedure.

Table 6.9: Variable Names for the ODS Tables Produced in PROC OPTMODEL
Table Name Variables
DerivMethodsLabel1, cValue1, and nValue1
OptStatisticsLabel1, cValue1, and nValue1
PrintTable (matrix form)ROW, COL1 - COLn, identifier-expression(_suffix)
PrintTable (table form)COL1 - COLn, identifier-expression(_suffix)
ProblemSummaryLabel1, cValue1, and nValue1
SolutionSummaryLabel1, cValue1, and nValue1
SolverOptionsLabel1, cValue1, nValue1, cValue2, and nValue2

The PRINT statement produces an ODS table named "PrintTable." The variable names used depend on the display format used. See the section "Formatted Output" for details on choosing the display format.

For the PRINT statement with table format, the columns that display array indices are named COL1 - COLn, where n is the number of index elements. Columns that display values from identifier expressions are named based on the expression's name and suffix. The identifier name becomes the output variable name if no suffix is used. Otherwise the variable name is formed by appending an underscore (_) and the suffix to the identifier name. Columns that display the value of expressions are named COLn, where n is the column number in the table.

For the PRINT statement with matrix format, the first column has the variable name ROW. The remaining columns are named COL1 - COLn where n is the number of distinct column indices. Columns that display values from identifier expressions are named based on the expression's name and suffix, as described in the case of table format.

The PRINTLEVEL= option controls the tables produced by the SOLVE statement. When PRINTLEVEL=0, the SOLVE statement produces no ODS tables. When PRINTLEVEL=1, the SOLVE statement produces the "ProblemSummary" and "SolutionSummary" tables. When PRINTLEVEL=2, the SOLVE statement produces the "ProblemSummary," "SolverOptions," "DerivMethods," "SolutionSummary," and "OptStatistics" tables.

The following code generates several ODS tables and writes each table to a SAS data set:

    proc optmodel printlevel=2;
       ods output PrintTable=expt ProblemSummary=exps DerivMethods=exdm 
                  SolverOptions=exso SolutionSummary=exss OptStatistics=exos;
       var x{1..2} >= 0;
       min z = 2*x[1] + 3 * x[2] + x[1]**2 + 10*x[2]**2 
               + 2.5*x[1]*x[2] + x[1]**3;
       con c1: x[1] - x[2] <= 1;
       con c2: x[1] + 2*x[2] >= 100;
       solve;
       print x;
 

The data set expt contains the Print table ("PrintTable") and is shown in Output 6.41. The variable names are COL1 and x.

Obs COL1 x
1 1 10.448
2 2 44.776


Figure 6.41: ODS Table "PrintTable"

The data set exps contains the Problem Summary table ("ProblemSummary") and is shown in Output 6.42. The variable names are Label1, cValue11, and nValue1. The rows describe the objective function, variables, and constraints. The rows depend on the form of the problem.

Obs Label1 cValue1 nValue1
1 Objective Sense Minimization .
2 Objective Function z .
3 Objective Type Nonlinear .
4     .
5 Number of Variables 2 2.000000
6 Bounded Above 0 0
7 Bounded Below 2 2.000000
8 Bounded Below and Above 0 0
9 Free 0 0
10 Fixed 0 0
11     .
12 Number of Constraints 2 2.000000
13 Linear LE (<=) 1 1.000000
14 Linear EQ (=) 0 0
15 Linear GE (>=) 1 1.000000
16 Linear Range 0 0


Figure 6.42: ODS Table "ProblemSummary"

The data set exso contains the Solver Options table ("SolverOptions") and is shown in Output 6.43. The variable names are Label1, cValue1, nValue1, cValue2, and nValue2. The rows, which depend on the solver called by PROC OPTMODEL, list the values taken by each of the solver options. The presence of an asterisk (*) next to an option indicates that a nondefault value has been specified for that option.

Obs Label1 cValue1 nValue1 cValue2 nValue2
1 TECH TRUREG .   .
2 ABSOPTTOL 0.001 0.001000   .
3 MAXFUNC 3000 3000.000000   .
4 MAXITER 500 500.000000   .
5 MAXTIME I I   .
6 OBJLIMIT 1E20 1E20   .
7 PRINTFREQ 0 0   .
8 RELOPTTOL 1E-6 0.000001000   .


Figure 6.43: ODS Table "SolverOptions"

The data set exdm contains the Methods of Derivative Computation table ("DerivMethods") and is shown in Output 6.44. The variable names are Label1, cValue11, and nValue1. The rows, which depend on the derivatives used by the solver, specify the method used to calculate each derivative.

Obs Label1 cValue1 nValue1
1 Objective Gradient Analytic Formulas .
2 Objective Hessian Analytic Formulas .


Figure 6.44: ODS Table "DerivMethods"

The data set exss contains the Solution Summary table ("SolutionSummary") and is shown in Output 6.45. The variable names are Label1, cValue11, and nValue1. The rows give an overview of the solution, including the solver chosen, the objective value, and the solution status. Depending on the values returned by the solver, the Solution Summary table might also include some solution quality values such as optimality error and infeasibility. The values in the Solution Summary table appear in the _OROPTMODEL_ macro variable; each solver chapter has a section describing the solver's contribution to this macro variable.

Obs Label1 cValue1 nValue1
1 Solver NLPC/Trust Region .
2 Objective Function z .
3 Solution Status Optimal .
4 Objective Value 22623.346619 22623
5 Iterations 4 4.000000
6     .
7 Absolute Optimality Error 8.6694316E-6 0.000008669
8 Relative Optimality Error 9.3760097E-9 9.3760097E-9
9 Absolute Infeasibility 1.065814E-14 1.065814E-14
10 Relative Infeasibility 1.055261E-16 1.055261E-16


Figure 6.45: ODS Table "SolutionSummary"

The data set exos contains the Optimization Statistics table ("OptStatistics") and is shown in Output 6.46. The variable names are Label1, cValue11, and nValue1. The rows, which depend on the solver called by PROC OPTMODEL, describe the amount of time and function evaluations used by the solver.

Obs Label1 cValue1 nValue1
1 Function Evaluations 9 9.000000
2 Gradient Evaluations 1 1.000000
3 Hessian Evaluations 5 5.000000
4 Problem Generation Time 0.00 0
5 Code Generation Time 0.00 0
6 Presolver Time 0.00 0
7 Solver Time 0.02 0.016000


Figure 6.46: ODS Table "OptStatistics"

Previous Page | Next Page | Top of Page