Chapter Contents

Previous

Next
%INCLUDE

%INCLUDE



Includes SAS statements and data lines

Valid: anywhere
OS/390 specifics: file-specification, JCLEXCL, options


Syntax
See Also

Syntax

%INCLUDE source-1 <. . . source-n>
</<SOURCE2> <S2=length> <JCLEXCL>>;

The following list explains some of the components of the %INCLUDE statement. See SAS Language Reference: Dictionary for the complete syntax information.

source
describes the location of the information that you want to access with the %INCLUDE statement. The three possible sources follow:

file-specification
Under OS/390, this can be a fileref or a physical file name enclosed in quotes.

internal-lines
You can access lines that were entered earlier in the same SAS job or session. In order to use this technique in a line mode session, the SAS system option SPOOL must be in effect.

keyboard-entry
You can enter the statements or data lines directly from the terminal. Use an asterisk (*) to indicate that the statements are to come from the terminal.

SOURCE2
causes the SAS log to show the source statements that are being included in your SAS program. In other words, this option has the same effect as the SAS system option SOURCE2, except that it applies only to the records that you are currently including. Specifying SOURCE2 in the %INCLUDE statement works even if the NOSOURCE2 system option is in effect.

S2=length
specifies the length of the record to be used for input. Possible values are
S sets S2 equal to the current setting of the SAS system option S=.
0 tells SAS to use the setting of the SAS system option SEQ= to determine whether the line contains a sequence field. If the line does contain a sequence field, SAS determines the line length by excluding the sequence field from the total length.
n indicates which columns SAS should scan and which columns, if any, contain sequence numbers that should be ignored. n specifies the column in which to start scanning (for variable-length records) or stop scanning (for fixed-length records).

If the source lines in an external file that you are including contain sequence numbers, then either delete them before including the SAS program in your SAS session, or specify S2=0.

JCLEXCL
ignores any lines of JCL in the included source.


See Also


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.