一般来说,我对编码和 SAS 还是很陌生。我尝试创建一堆与行数相对应的 KPI 图表,但下面的循环代码不断为最后一行创建两个相同的 GPKI 图表。为什么会这样?任何帮助将不胜感激。
谢谢
%Macro scanloop (scanfile,field1,field2,field3);
data _null_;
if 0 then set &scanfile nobs=X;
call symput ('Count',X);
stop;
run;
%DO I=1 %To &count;
Data _null_;
set &scanfile (firstobs=&I);
call symput('Client', &field1);
call symput('LossRatio', &field2 );
call symput('Target', &field3 );
stop;
run;
proc gkpi mode=raised;
speedometer actual=&LossRatio bounds=(0 .2 .4 .6 .8 1) /
target=&Target label="&field1 KPI" nolowbound format="percent8.0"
afont=(f="Albany AMT" height=.5cm)
bfont=(f="Albany AMT" height=.4cm) ;
Run;
%end;
%MEND SCANLOOP;
%scanloop (work.Test, Client,LossRatio,Target);run;