proc optmodel; set Plant = {"P1", "P2"}; set Center = {"CA", "CB"}; set Region = {"R1", "R2", "R3"}; number capacity{Plant} = [100 125]; number demand{Region} = [25 95 80]; number incost{Plant, Center} = [ 190 210 185 205 ]; number outcost{Center, Region} = [ 175 180 165 235 130 145 ]; var inflow{Plant, Center} >= 0; var outflow{Center, Region} >= 0; minimize z = sum{i in Plant, k in Center}inflow[i,k]*incost[i,k]+ sum{k in Center, j in Region}outflow[k,j]*outcost[k,j] ; con capacitycon{i in Plant}: sum{k in Center}inflow[i,k] <= capacity[i]; con demandcon{j in Region}: sum{k in Center}outflow[k,j] >= demand[j]; con balancecon{k in Center}: sum{i in Plant}inflow[i,k] = sum{j in Region}outflow[k,j]; solve; print z inflow outflow; expand; quit;