先谢谢论坛的诸位,小弟几乎已经要完成处女程序了。下面这个过程,我实在不知错误如何改。系统提示错在我画红线的地方,还请诸位花点时间,不吝赐教。
data c1;
set c1 nobs=nobs;
call symput ('nobs1',nobs);
run;
data c2;
set c2 nobs=nobs;
call symput ('nobs2',nobs);
run;
data c3;
set c3 nobs=nobs;
call symput ('nobs3',nobs);
run;
data c4;
set c4 nobs=nobs;
call symput ('nobs4',nobs);
run;
data b;
set b nobs=nobs;
call symput ('nobsb',nobs);
run;
data trade&d;
set b;
com=1;trade=1;
pb=(&nobs1 /(&nobsb -1))*high+(&nobs2 /(&nobsb -1))*low+(&nobs3 /(&nobsb -1))*(0.5*high+0.5*low)+(&nobs4 /(&nobsb -1))*low;
ps=1.02*pb;
if pb<nlow then suc=0;income=0;
if pb>=nlow & ps>=n2high then suc=0;income=(n2low-pb)/pb;
if pb>=nlow & ps<n2high then suc=1;income=(max(ps,n2low)-pb)/pb;
run;