/*----------------------------------------------------------------
                                                                 
            S A S   S A M P L E   L I B R A R Y                  
                                                                 
      NAME: dcmpg01                                              
     TITLE: Getting Started Example (dcmpg01)                    
   PRODUCT: OR                                                   
    SYSTEM: ALL                                                  
      KEYS: OR                                                   
     PROCS: OPTMODEL                                             
      DATA:                                                      
                                                                 
   SUPPORT:                             UPDATE:                  
       REF:                                                      
      MISC: Example 1 from the Getting Started section of the    
            Decomposition Algorithm chapter of Mathematical      
            Programming.                                         
                                                                 
----------------------------------------------------------------*/


proc optmodel;
   var x{i in 1..3, j in 1..2} binary;

   max f =    x[1,1] + 2*x[2,1] +   x[3,1]
                     +   x[2,2] +   x[3,2];

   con m :    x[1,1] +   x[1,2]            >=  1;
   con s1:  5*x[1,1] + 7*x[2,1] + 4*x[3,1] <= 11;
   con s2:    x[1,2] + 2*x[2,2] +   x[3,2] <=  2;

   s1.block = 0;
   s2.block = 1;

   solve with milp / presolver=none decomp=(logfreq=1);
   print x;
quit;