各位大虾们,下面是我运行朱世武教授书上的程序如下:
%macro create;
data=temp;
set Resdat.&dat end=final;
if year(date)=&year then do;
n+1;
output;
end;
if final then call symput("number",n);
/*创建的宏变量为number,其值为n*/
run;
%mend create;
%macro plot;
proc gplot data=temp;
title2"&pr &year1时序图";
plot &price*date=1;
symbol1 v=star i=join r=1 c=red;
%mend plot;
run;
%macro analyze(getdata,dat,year,pr,price,year1);
%if %upcase(&getdata)=yes %then %create;
footnote "plot of &number of observations";
%plot;
%mend analyze;
run;
%analyze(yes,Idx000001,1999,收盘价,clpr,1999);
%analyze(yes,Idx000002,1999,收盘价,clpr,1999);
%analyze(yes,Idx000001,1999,收盘价,clpr,2000);
%analyze(yes,Idx000002,1999,收盘价,clpr,2000);
run;
在前面编译都非常正常,但是运行到宏analyse时出错,log上面显示错误如下:
597 %analyze(yes,Idx000001,1999,收盘价,clpr,1999);
WARNING: Apparent symbolic reference NUMBER not resolved.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GPLOT used:
real time 8.80 seconds
cpu time 0.01 seconds
ERROR:File WORK.TEMP.DATA does not exist.
WARNING: Apparent symbolic reference YEAR1时序图 not resolved.
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
598 %analyze(yes,Idx000002,1999,收盘价,clpr,1999);
WARNING: Apparent symbolic reference NUMBER not resolved.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GPLOT used:
real time 0.01 seconds
cpu time 0.01 seconds
ERROR: File WORK.TEMP.DATA does not exist.
WARNING: Apparent symbolic reference YEAR1时序图 not resolved.
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
599 %analyze(yes,Idx000001,1999,收盘价,clpr,2000);
WARNING: Apparent symbolic reference NUMBER not resolved.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GPLOT used:
real time 0.01 seconds
cpu time 0.00 seconds
ERROR: File WORK.TEMP.DATA does not exist.
WARNING: Apparent symbolic reference YEAR1时序图 not resolved.
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
600 %analyze(yes,Idx000002,1999,收盘价,clpr,2000);
WARNING: Apparent symbolic reference NUMBER not resolved.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE GPLOT used:
real time 0.01 seconds
cpu time 0.00 seconds
ERROR: File WORK.TEMP.DATA does not exist.
WARNING: Apparent symbolic reference YEAR1时序图 not resolved.
WARNING: The TITLE statement is ambiguous due to invalid options or unquoted text.
601 run;
WARNING: RUN statement ignored due to previous errors. Submit QUIT; to terminate the procedure.