If I understand correctly, the following code does what you want:
data have;
set mm_out_x6_x;
rename _tmin=method1 _tmin_ew=method2 _tmin_wt_r=method3 _tmin_wt_r2=method4;
run;
proc optmodel;
/* read input data */
set METHODS = 1..4;
set <str,num,num> DATE_BLOCK_TREATMENT;
num _tmin_orig {DATE_BLOCK_TREATMENT};
num outcome {DATE_BLOCK_TREATMENT, METHODS};
read data have into DATE_BLOCK_TREATMENT=[dt bloc condi_id] _tmin_orig
{m in METHODS} <outcome[dt,bloc,condi_id,m]=col('method'||m)>;
set TREATMENTS = setof {<d,b,t> in DATE_BLOCK_TREATMENT} t;
set DATE_BLOCK = setof {<d,b,t> in DATE_BLOCK_TREATMENT} <d,b>;
/* define optimization model */
var SelectMethod {METHODS} binary;
var SelectTreatment {TREATMENTS} binary;
var IsGood {DATE_BLOCK} binary;
/* if IsGood[d,b] = 1 then Score[d,b] = 1 else Score[d,b] = -5 */
impvar Score {<d,b> in DATE_BLOCK} = 1 * IsGood[d,b] - 5 * (1 - IsGood[d,b]);
max TotalScore = sum {<d,b> in DATE_BLOCK} Score[d,b];
con CardinalityMethod:
sum {m in METHODS} SelectMethod[m] = 1;
con CardinalityTreatment:
sum {t in TREATMENTS} SelectTreatment[t] = 2;
/* if IsGood[d,b] = SelectMethod[m] = SelectTreatment[t] = 1 then outcome[d,b,t,m] < _tmin_orig[d,b,t] */
con NoGood {<d,b,t> in DATE_BLOCK_TREATMENT, m in METHODS: outcome[d,b,t,m] >= _tmin_orig[d,b,t]}:
IsGood[d,b] + SelectMethod[m] + SelectTreatment[t] <= 2;
/* call MILP solver */
solve;
/* create output data */
create data want_method from [method] SelectMethod;
create data want_treatment from [treatment] SelectTreatment;
create data want_dt_bloc from [dt bloc] IsGood Score;
quit;
An optimal solution selects method 3 and treatments 12 and 15, yielding a maximum total score of -21.
If this does not match your expectation, please provide a sample solution, together with the calculation of its total score.
... View more