%do k=1 %to &color_num.;
proc sql;
select otd_percent into:color_ratio%left(&k.)
from or.tm_color_forecast2 (where=(cal_date="30NOV2012"d and pack="3SE1" and color="&&color%left(&k.)"));
%end;
proc optmodel;
number m=&color_num.;
number color_ratio{c in 1..m};
var n;
do n=1 to m; color_ratio[n]="&&color_ratio||n"; end;
quit;
%mend;
%try;
部分程序如上,不知道有什么办法能把之前的那个数组读入进去。我试了写成上面这种情况的时候,报错是说
ERROR 575-782: The expression type, a string, does not match target, a number.
但是如果写成
color_ratio[n]=&color_ratio||n;的话,就把&识别成了and;
不过直接这样写是可以的:color_ratio[1]=&color_ratio1;。
求指教,万分感激



雷达卡





京公网安备 11010802022788号







