The OPTMODEL Procedure |
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;
Copyright © 2008 by SAS Institute Inc., Cary, NC, USA. All rights reserved.