g*******s 发帖数: 59 | 1 dataset ts; ts 包含dependent variable : orig_fl_bal_0,
independent variable: c1 c2 c3 c4
目的是实现proc model fit的自动化;
程序如下:
%let iv_list = c1 c2 c3 c4;
%global finalResult;
%global macrolist2;
%macro generateResults(varlist);
%let result = a&k.;
%let macrolist = a&k.;
%let k = %str(1);
%do %while(%scan(&varlist, (%sysevalf(&k))) ne );
%let iv = %scan(&varlist,(&sysevalf(&k)));
%let finalResult = &result + b&k.*&iv;
%let result = &finalResult;
%let macrolist2 = ¯olist b&k.;
%let macrolist = ¯olist2;
%let k = %eval(&k+1);
%end;
%mend generateResults;
%generateResults(&iv_list);
proc model data=ds;
params ¯olist2.;
orig_fl_bal_o = &finalResult.;
fit orig_fl_bal_o / white breusch = (1 &iv_list.);
run;
quit;
error: Note :line generated by the macro variable "FinalResult!"
! a1 + b1*c1+b2*c2+b3*c3+b4*c4;
Error 22-322
各位大侠, 字符串都转化了为什么还是无法工作?请指教!
谢谢!! |
|