上面的写法没有错,就应该等于0。
试试这个:
%let numPercentage=%[color=red:787e0]sysevalf[/color:787e0]((&numRecordCount/&numBaseTableCount)*100);作者: shiyiming 时间: 2003-10-17 16:40
COOL,谢谢老大!
但是如果numRecordCount和numBaseTableCount都是由select count(*) into :numRecordCount from TableA和select count(*) into :numBaseTableCount from BaseTable得来的,结果似乎还是不对。有何良策?作者: shiyiming 时间: 2003-10-18 00:10
是这个意思吗?好象没错呀!
data a;
do x=1 to 12;
output;
end;
run;
data b;
do y=1 to 48;
output;
end;
run;
proc sql;
select count(*) into :aa from a;
select count(*) into :bb from b;
quit;
%let cc=%sysevalf((&aa/&bb)*100);
%put &cc;作者: shiyiming 时间: 2003-10-18 09:16
没错,就是这个意思,你的能跑正确。但在我实际程序中的确不成功。
不过没关系,实在不行,我用data step来计算,再用call symput赋值。
谢谢!作者: shiyiming 时间: 2003-10-20 09:08 标题: to Jerry兄 这段代码测试过吗??作者: shiyiming 时间: 2003-10-20 11:41
[quote="shiyiming":c7695]COOL,谢谢老大!
但是如果numRecordCount和numBaseTableCount都是由select count(*) into :numRecordCount from TableA和select count(*) into :numBaseTableCount from BaseTable得来的,结果似乎还是不对。有何良策?[/quote:c7695]
log中是否显示:
WARNING: Apparent symbolic reference NUMRECORDCOUNT not resolved.
....等等?