The OPTMODEL Procedure

SAVE MPS Statement

SAVE MPS SAS-data-set;

The SAVE MPS statement saves the structure and coefficients for a linear programming model into a SAS data set. This data set can be used as input data for the OPTLP or OPTMILP procedure.

Note: The OPTMODEL presolver (see the section "Presolver") is automatically bypassed so that the statement saves the original model without eliminating fixed variables, tightening bounds, etc.

The SAS-data-set argument specifies the output data set name and options. The output data set uses the MPS format described in Chapter 14. The generated data set contains observations that define different parts of the linear program.

Variables, constraints, and objectives are referenced in the data set by using label text based on the model name. For example, a model variable x[1] would be labeled "x[1]" in the data set. Labels are limited by default to 32 characters and are abbreviated to fit. You can change the maximum length for labels by using the MAXLABLEN= option. When needed, a programmatically generated number is added to labels to avoid duplication. Only the most recent objective, which was specified in a MIN or MAX declaration or specified in a SOLVE statement, is included in the data set.

When an integer variable has been assigned a nondefault branching priority or direction, the MPS data set includes a BRANCH section. See Chapter 14, "The MPS-Format SAS Data Set," for more details.

The following code shows an example of the SAVE MPS statement. The model is specified using the OPTMODEL procedure. Then it is saved as the MPS data set MPSData, as shown in Output 6.26. Next, PROC OPTLP is used to solve the resulting linear program.

    proc optmodel;
       var x >= 0, y >= 0;
       con c: x >= y;
       con bx: x <= 2;
       con by: y <= 1;
       min obj=0.5*x-y;
       save mps MPSData;
    quit;
    proc optlp data=MPSData pout=PrimalOut dout=DualOut;
    run;
 


Obs FIELD1 FIELD2 FIELD3 FIELD4 FIELD5 FIELD6
1 NAME   MPSData .   .
2 ROWS     .   .
3 N obj   .   .
4 G c   .   .
5 L bx   .   .
6 L by   .   .
7 COLUMNS     .   .
8   x obj 0.5 c 1
9   x bx 1.0   .
10   y obj -1.0 c -1
11   y by 1.0   .
12 RHS     .   .
13   .RHS. bx 2.0   .
14   .RHS. by 1.0   .
15 ENDATA     .   .


Figure 6.26: The MPS Data Set Generated by SAVE MPS Statement

Previous Page | Next Page | Top of Page