全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1193 2
2013-03-31
我用call execute 運行一個macro, macro里用用proc sql select into產生一個Macro variable, 但這個macro variables 好像得不出值來.
請問這是什麼原因...非常感謝.

以下紅字的地方好像根本不起作用..求解釋!!!
如果我運行%allfuture(productA); %allfuture(productB); %allfuture(productC); 程序是沒問題可以運行的.

程序如下:

%macro Allfuture(name);

proc sort data=o.&name. out=future.&name; by date; run;

proc contents data=future.&name. out=temp.var  noprint;
run;

proc sql  noprint;
select distinct name into :V  separated by " " from temp.var where name not like '%VAR%' and name not in ( "Date");
quit;

%put &V.;

proc transpose data=future.&name out=future.&name.2 (rename=col1=price) name=contract;
by date;
var &V.;
run;

data future.&name.2;
set  future.&name.2;
format product $12.;
product="&name.";
run;

proc append base=future.FutureAll data=future.&name.2;run;

%mend;

data _null_;
set temp.products;
call execute('%Allfuture('||product||')');
run;

二维码

扫码加我 拉你入群

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

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

全部回复
2013-3-31 21:35:56
data _null_;
set temp.products;
call execute('%nrstr(%Allfuture('||product||'))');
run;
二维码

扫码加我 拉你入群

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

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

2013-3-31 23:53:32
pobel 发表于 2013-3-31 21:35
data _null_;
set temp.products;
call execute('%nrstr(%Allfuture('||product||'))');
It works!!!!! many thanks!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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