帮看程序先:
%macro rate(type,promise);
proc sql;
select rate
from bank_rate as n
where &promise eq n.promise and &type=n.type;
%mend rate;
我要做的:我想引用spl过程检索到的rate值,在以后进行相应的计算。比如说我调用%rate(5,3);得到结果是0.0072.可不可以将这个值赋给一个变量,或者其他方法,以便以后计算。
谢谢各位!
问题在於,我想在我想在宏外面应用
%macro rate(type,promise);
proc sql;
select rate into : rate
from bank_rate as n
where &promise eq n.promise and &type=n.type;
%mend rate;
%rate(5,3);
%put rate;
报错:WARNING: Apparent symbolic reference RATE not resolved.
Be aware of the scope of your macro symbol. &rate was created local but you're trying to reference it out of its scope. you may add a %global statement within your macro.
[url:1zvlod3m]http://www.technion.ac.il/docs/sas/macro/z1072111.htm[/url:1zvlod3m]