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 an indexset specification, the index set consists of one or more indexsetitems that are separated by commas. Each indexsetitem can include local dummy parameter declarations. An optional selection expression follows the list of indexsetitems. The following syntax, which describes an index set, usually appears in braces ({}):
indexsetitem
, …indexsetitem
: logicexpression
;
indexsetitem has these forms:
setexpression ;
name IN setexpression ;
< name1
, …namen
> IN setexpression ;
Names that precede the IN keyword in indexsetitems declare local dummy parameter names. Dummy parameters correspond to the dummy index variables in mathematical expressions. For example, the following statements output the number 385:
proc optmodel; put (sum{i in 1..10} i**2);
The preceding statements evaluate this summation:

In both the statements and the summation, the index name is .
The last form of indexsetitem 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.