This example demonstrates the use of the MPSOUT= option to convert problem data in PROC LP input format into an MPS-format SAS data set for use with the OPTLP procedure.
Consider the oil blending problem introduced in the section An Introductory Example. Suppose you have saved the problem data in dense format by using the following DATA step:
data exdata; input _id_ $17. a_light a_heavy brega naphthal naphthai heatingo jet_1 jet_2 _type_ $ _rhs_; datalines; profit -175 -165 -205 0 0 0 300 300 max . naphtha_l_conv .035 .030 .045 -1 0 0 0 0 eq 0 naphtha_i_conv .100 .075 .135 0 -1 0 0 0 eq 0 heating_o_conv .390 .300 .430 0 0 -1 0 0 eq 0 recipe_1 0 0 0 0 .3 .7 -1 0 eq 0 recipe_2 0 0 0 .2 0 .8 0 -1 eq 0 available 110 165 80 . . . . . upperbd . ;
If you decide to solve the problem by using the OPTLP procedure, you will need to convert the data set exdata
from dense format to MPS format. You can accomplish this by using the following statements:
proc lp data=exdata mpsout=mpsdata; run;
The MPS-format SAS data set mpsdata
is shown in Output 6.15.1.
Output 6.15.1: Data Set mpsdata
Obs | FIELD1 | FIELD2 | FIELD3 | FIELD4 | FIELD5 | FIELD6 |
---|---|---|---|---|---|---|
1 | NAME | PROBLEM | . | . | ||
2 | ROWS | . | . | |||
3 | MAX | profit | . | . | ||
4 | E | naphtha_l_conv | . | . | ||
5 | E | naphtha_i_conv | . | . | ||
6 | E | heating_o_conv | . | . | ||
7 | E | recipe_1 | . | . | ||
8 | E | recipe_2 | . | . | ||
9 | COLUMNS | . | . | |||
10 | a_light | profit | -175.000 | naphtha_l_conv | 0.035 | |
11 | a_light | naphtha_i_conv | 0.100 | heating_o_conv | 0.390 | |
12 | a_heavy | profit | -165.000 | naphtha_l_conv | 0.030 | |
13 | a_heavy | naphtha_i_conv | 0.075 | heating_o_conv | 0.300 | |
14 | brega | profit | -205.000 | naphtha_l_conv | 0.045 | |
15 | brega | naphtha_i_conv | 0.135 | heating_o_conv | 0.430 | |
16 | naphthal | naphtha_l_conv | -1.000 | recipe_2 | 0.200 | |
17 | naphthai | naphtha_i_conv | -1.000 | recipe_1 | 0.300 | |
18 | heatingo | heating_o_conv | -1.000 | recipe_1 | 0.700 | |
19 | heatingo | recipe_2 | 0.800 | . | ||
20 | jet_1 | profit | 300.000 | recipe_1 | -1.000 | |
21 | jet_2 | profit | 300.000 | recipe_2 | -1.000 | |
22 | BOUNDS | . | . | |||
23 | UP | .BOUNDS. | a_light | 110.000 | . | |
24 | UP | .BOUNDS. | a_heavy | 165.000 | . | |
25 | UP | .BOUNDS. | brega | 80.000 | . | |
26 | ENDATA | . | . |
Now that the problem data are in MPS format, you can solve the problem by using the OPTLP procedure. For more information, see Chapter 10: The OPTLP Procedure in SAS/OR 12.1 User's Guide: Mathematical Programming.