All PROC OPTMODEL options can be specified in the PROC statement (see the section PROC OPTMODEL Statement for more information). However, it is sometimes necessary to change options after other PROC OPTMODEL statements have been executed. For example, if an optimization technique had trouble with convergence, then it might be useful to vary the PRESOLVER= option value. This can be done with the RESET OPTIONS statement.
The RESET OPTIONS statement accepts options in the same form used by the PROC OPTMODEL statement. The RESET OPTIONS statement
is also able to reset option values and to change options programmatically. For example, the following statements print the
value of parameter n
at various precisions:
proc optmodel; number n = 1/7; for {i in 1..9 by 4} do; reset options pdigits=(i); print n; end; reset options pdigits; /* reset to default */
The output generated is shown in Figure 5.62. The RESET OPTIONS statement in the DO loop sets the PDIGITS option to the value of i
. The final RESET OPTIONS statement restores the default option value, because the value was omitted.
Figure 5.62: Changing the PDIGITS Option Value
n |
---|
0.1 |
n |
---|
0.14286 |
n |
---|
0.142857143 |