The OPTMODEL Procedure |
An index set represents a set of combinations of members from the component set expressions. The index set notation is used in PROC OPTMODEL to describe collections of valid array indices and to specify sets of values with which to perform an operation. Index sets can declare local dummy parameters and can further restrict the set of combinations by a selection expression.
In { index-set }, the index-set consists of one or more index-set-items that are separated by commas. Each index-set-item can include local dummy parameter declarations. An optional selection expression follows the list of index-set-items. This syntax describes an index-set:
proc optmodel; put (sum{i in 1..10} i**2);
In both the code and the summation the index name is .
The last form of index-set-item in the list can be modified to use the SLICE expression implicitly. See the section "More on Index Sets" for details.
Array index sets cannot be defined using functions that return different values each time the functions are called. See the section "Indexing" for details.
PROC OPTMODEL will produce this output:
{<2000,'Q1'>,<2000,'Q2'>,<2000,'Q3'>,<2000,'Q4'>, <2001,'Q1'>,<2001,'Q2'>,<2001,'Q3'>,<2001,'Q4'>}
The set order that results from other operations, such as the UNION operator, is not specified. This actual order could differ each time the operation is performed. However once a set value is assigned to a parameter the order will not change unless the parameter needs to be recomputed.
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.