我想从已经存在的其他宏变量中创建一个新的宏变量。
我尝试了call symput
,%eval
和input
的多种变体无效...
我希望d
评估为3/30 = .10。
***** taken directly from the sas help files... ;
%let a=1+2;
%let b=10*3;
%let c=5/3;
%let eval_a=%eval(&a);
%let eval_b=%eval(&b);
%let eval_c=%eval(&c);
%put &a is &eval_a;
%put &b is &eval_b;
%put &c is &eval_c; * not sure why this evaluates to 1, but I'm sure it's documented somewhere... ;
***** This evaluates to 0...
%let d = %eval(%eval(&a) / %eval(&b)) ;
%put &d ;
非常感谢...
答案 0 :(得分:4)
%eval只会返回一个整数。要获得小数,您需要使用%sysevalf。