Chapter Contents |
Previous |
Next |
%INCLUDE |
Language element: | statement |
Valid: | anywhere in a SAS program |
OpenVMS specifics: | valid values for source, if a file specification is used |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
%INCLUDE source-1 < . . .
source-n>
|
This section discusses only external file specifications. For information about including lines from your terminal or from your SAS session, see Recalling SAS Statements and the SAS statements portion of SAS Language Reference: Dictionary.
Details |
When you execute a program that contains the %INCLUDE statement, the SAS System executes your code, including any statements or data lines that you bring into the program with %INCLUDE.
The %INCLUDE statement is most often used when running SAS in interactive line mode, noninteractive mode, or batch mode. Although you can use the %INCLUDE statement when running SAS using windows, it may be more practical to use the INCLUDE and RECALL commands to access data lines and program statements, and submit these lines again.
The %INCLUDE statement executes statements immediately.
Example |
The following is an example of a %INCLUDE statement. Suppose you have issued the following FILENAME statement:
filename mypgm '[mydir]program1.sas';
Then, in a SAS program you can issue the following %INCLUDE statement to copy in and execute the SAS statements stored in the file PROGRAM1.SAS:
%include mypgm;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.