Syntax, %INCLUDE statement:
%INCLUDE file-specification </SOURCE2>;
file-specification
describes the location
of the file that contains the SAS code to be inserted.
SOURCE2
causes the SAS statements
that are inserted into the program to be displayed in the SAS log.
If SOURCE2 is not specified in the %INCLUDE statement, then the setting
of the SAS system option SOURCE2 controls whether the inserted code
is displayed.
|
C:Userscertadvprtlast.sas
:
%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;
%include 'C:Userscertadvprtlast.sas' /source2; proc sort data=certadv.courses out=work.bydays; by days; run; %prtlast
NOTE: %INCLUDE (level 1) file prtlast.sas is file C:Userscertadvprtlast.sas. 31 +%macro prtlast; 32 + %if &syslast ne _NULL_ %then %do; 33 + proc print data=&syslast(obs=5); 34 + title “Listing of &syslast data set”; 35 + run; 36 + %end; 37 + %else 38 + %put No data set has been created yet.; 39 +%mend; NOTE: %INCLUDE (level 1) ending. 40 41 proc sort data=certadv.courses out=work.bydays; 42 by days; 43 run; NOTE: There were 6 observations read from the dataset CERTADV.COURSES. NOTE: The data set WORK.BYDAYS has 6 observations and 4 variables. NOTE: PROCEDURE SORT used: real time 0.04 seconds cpu time 0.04 seconds 44 45 %prtlast NOTE: There were 5 observations read from the dataset WORK.BYDAYS. NOTE: PROCEDURE PRINT used: real time 1.07 seconds cpu time 0.26 seconds