%INCLUDE Statement: Windows

Includes and executes SAS statements and data lines.
Valid in: anywhere in a SAS program
Windows specifics: source, if a file specification is used; valid options for encoding-value and host-options
See: %INCLUDE Statement in SAS Statements: Reference

Syntax

%INCLUDE source </<ENCODING='encoding-value'> <host-options> > ;

Required Arguments

This version is a simplified version of the %INCLUDE statement syntax. For the complete syntax and its explanation, see the %INCLUDE statement in %INCLUDE Statement in SAS Statements: Reference.

source
describes the location of the information that you want to access. The two possible sources are a file specification or internal lines. Under Windows, an asterisk (*) cannot be used to specify keyboard entry. The file specification can be any of the file specification forms discussed in Referencing External Files.
When using member-name syntax and the member name contains a leading digit, enclose the member name in quotation marks. If the member name contains a macro variable reference, use double quotation marks.
ENCODING='encoding-value'
specifies the encoding to use when reading from the specified source. The value for ENCODING= indicates that the specified source has a different encoding from the current session encoding.
When you read data from the specified source, SAS transcodes the data from the specified encoding to the session encoding.
For valid encoding values, see Encoding Values in SAS Language Elements in SAS National Language Support (NLS): Reference Guide.
host-options
consists of statement options that are valid under Windows. Remember to precede the options list with a forward slash (/). The following options are available under Windows:
BLKSIZE=block-sizeBLK=block-size
specifies the number of bytes that are physically read or written in an I/O operation. The default is 8K. The maximum is 1M.
BLOCK | NOBLOCK
is used only in the context of named pipes. This option indicates whether the client is to wait if no data is currently available.
BYTE | MESSAGE
is used only in the context of named pipes. This option indicates the type of pipe; BYTE is the default value.
EOFCONNECT
is used only in the context of named pipes and is valid only when defining the server. This option indicates that the server should try to connect to the next client if an end-of-file (EOF) character is received from a client.
IGNOREDOSEOF
is used in the context of I/O operations on variable record format files. When this option is specified, any occurrence of ^Z is interpreted as character data and not as an end-of-file marker.
LRECL=record-length
specifies the record length (in bytes). Under Windows, the default is 256. The value of record-length can range from 1 to 1,073,741,823 ( 1 gigabyte).
NOTAB
is used only in the context of Dynamic Data Exchange. This option enables you to use non-tab character delimiters between variables. For more information, see Using the NOTAB Option with DDE.
RECFM=record-format
controls the record format. The following values are valid under Windows:
F indicates fixed format.
N indicates binary format and causes the file to be treated as a byte stream. If LRECL is not specified, by default SAS reads 256 bytes at a time from the file.
P indicates print format.
S370V indicates the variable S370 record format (V).
S370VB indicates the variable block S370 record format (VB).
S370VBS indicates the variable block with spanned records S370 record format (VBS).
V|D indicates variable format. This format is the default.
The S370 values are valid with files laid out as z/OS files only—that is, files that are binary, have variable-length records, and are in EBCDIC format. If you want to use a fixed-format z/OS file, first copy it to a variable-length, binary z/OS file.

Details

When you execute a program that contains the %INCLUDE statement, SAS executes your code, including any statements or data lines that you bring into the program with %INCLUDE.
When using the keyboard method for preparing a program so that you can interrupt the current program's execution, the asterisk (*) cannot be used to specify keyboard entry if you use the Enhanced Editor in the Microsoft Windows operating environment. For more information about the keyboard entry method, see %INCLUDE Statement in SAS Statements: Reference.