Hi All, I have just started using the proc optmodel and I need help on calculation of max of a value for all ids in a data set with constraint values of a & b aggregated over all ids. For example - data new; input id$ a b ; datalines; 1 5 4 2 6 5 3 5 3 4 6 4 ; Now I want to solve for x that maximizes Z = (a + bx) for all ids in data i.e. for id 1, 2 and etc. My Code was like below - proc optmodel; set <str> DATA; var X{DATA} >= 0; num a{DATA}; num b{DATA}; max Z = (a[i] + b[i]*X[i]); con sum{i in DATA} (a[i]+b[i])=5; read data new into DATA = [id] a b; solve with LP /logfreq= 1 ; print X; quit; But I am getting the below error - ERROR 525-782: The symbol 'i' is unknown. ERROR 621-782: Subscript 1 must be a string, found a number. I would really appreciate some help on this. Thanks
... View more