我用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;