|
板凳

楼主 |
发表于 2004-11-11 22:56:05
|
只看该作者
I don't think online doc cover my topic
I already reviewed online doc and that topic do not cover what I want.
There 4 ways to call Macro:
1- session compiled macro
2- %include statement (External file or SOURCE catalog entry)
3- Autocall facility (External file or SOURCE catalog entry)
4- Stored compiled Macro
My question is about %include statement(Source catalog entry)
By the way, when I use autocall, I still have problem, here is my code:
%macro prtlast;
%if &syslast ne _NULL_ %then %do;
proc print data=&syslast(obs=5);
title "Listing of &syslast data set";
run;
%end;
%else
%put No data set has been created yet.;
%mend;
I save it as C:\prtlast.sas and I try to call this macro in another SAS program with code like:
options mautosource sasautos='C:\';
%include prtlast/ source2;
data course;
infile datalines dsd dlm=',';
length teacher $20;
input course_id teacher $ tuition;
datalines;
1,"James liu",1000
2,"Gary Guo",2341
3,"Someone else",231
4,"Vivian Pan",1000
5,"feng gao",1000
;
run;
%prtlast
I got
WARNING: Physical file does not exist, C:\Documents and Settings\gary_guo\prtlast.sas.
ERROR: Cannot open %INCLUDE file PRINTLAST.
I do not know why autocall facility doesn't work. I checked the system option, the option of SASAUTOS is set to "C:\". |
|