Yes, I'm using PROC OPTMODEL. Below code is for a sample of 400K customers. The full dataset has 30MM customers. Here's the code and I have attached the log file:- proc optmodel; /* declare sets and data indexed by sets */ set <string> Email; set <string> Brand; set <number> Custs; num Circulation{Email}; num Priority{Email}; num Percentage{Brand}; num ExpectedSpend{Custs,Email,Brand}; /* declare the variable */ var Pick{Custs,Email} binary init 0; /* maximize objective function (Total Spend) */ maximize TotalSpend = sum{i in Custs, j in Email, k in Brand} ExpectedSpend[i,j,k] * Pick[i,j] * Priority[j]; /* subject to constraints */ con CircLimit {j in Email} : sum {i in Custs} Pick[i,j] <= Circulation[j]; con indvMailconstraint {i in Custs}: sum {j in Email} Pick[i,j] = 1; con brandSalesLimit {k in Brand}: sum {i in Custs, j in Email} ExpectedSpend[i,j,k] * Pick[i,j] * Priority[j] >= Percentage[k] * TotalSpend / 100; /* abstract algebraic model that captures the structure of the */ /* optimization problem has been defined without referring */ /* to a single data constant */ /* populate model by reading in the specific data instance */ read data Email into Email=[Email] Circulation Priority; read data Brand into Brand=[Brand] Percentage; read data Customer into Custs=[Customer]; read data ExpSpend into [Customer Email Brand] ExpectedSpend[Customer, Email, Brand]=ExpSpend; /* solve LP using primal simplex solver */ solve with lp / solver = primal_spx; /* display solution */ print TotalSpend; create data results.solution from [customer email]={Custs, Email} Assignment=Pick; quit;
... View more