Code runs fine on the latest version of SAS/OR. For an older version, adding a small amount to denominator can fix the issue. Can you try this one:
data elast_input;
input segid $ rtechg_1 rtechg_2 rtechg_3 wgt_1 wgt_2 wgt_3 roewgt_1 roewgt_2 roewgt_3;
datalines;
AAA -0.0020 0.0000 0.0020 7000000 6800000 6000000 530000 560000 600000
AAB -0.0022 0.0000 0.0022 5000000 4900000 4850000 450000 490000 500000
AAC -0.0017 0.0000 0.0017 6500000 6150000 6000000 800000 820000 850000
AAD -0.0010 0.0000 0.0010 8000000 7950000 7900000 250000 270000 300000
;
proc optmodel;
set <string> segment;
set rate = 1..3;
num rtechg {segment, rate};
num wgt {segment, rate};
num roewgt {segment, rate};
read data elast_input into segment=[segid] {j in rate} <rtechg[segid,j]=col('rtechg_'||(j))>;
read data elast_input into segment=[segid] {j in rate} <wgt[segid,j]=col('wgt_'||(j))>;
read data elast_input into segment=[segid] {j in rate} <roewgt[segid,j]=col('roewgt_'||(j))>;
print rtechg wgt roewgt;
var X {segment, rate} binary;
max roe = (sum {segid in segment, j in rate} (roewgt[segid,j]*X[segid,j])) / (sum {segid in segment, j in rate} (wgt[segid,j]*X[segid,j]) + 1e-12);
con SelectOne {segid in segment}:
sum {j in rate} X[segid,j] = 1;
solve with lso;
print X;
quit;
Notice that I have added 1e-12 to the denominator of roe.
... View more