全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1377 1
2017-06-13
请教一下各位大神,我创建了宏变量,但是却引用不了是怎么回事呢?


%macro count(where=,ord=);

proc sql noprint;
    select count(distinct a) into : p3&ord. from test where &where. and c=1 ;
    select count(distinct a) into : p4&ord. from test where &where. and c=2 ;
quit;
%mend;

%count(where=b=1,ord=m);

%put &p4m;


log 显示说:
%put &p4m;
WARNING: Apparent symbolic reference P4M not resolved.


我把macro中的noprint去掉,是会正常显示宏变量的值。但是我用 %put语句,log却显示 not resolved....
只能请教各位了。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-6-13 17:00:47
自问自答好了: 其实只要把p3&ord p4&ord 变成global 宏变量就好了。
我是以为select into生成的应该直接是全局宏变量呀。。懵逼。。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群