This command is available
in the
Program Editor window as well as in
any other window that uses the SAS Text Editor such as the
Notepad window.
You can also include an external file from the MEMLIST or FNAME windows
by using selection-field commands. You can identify the external file
by specifying either a fileref or the physical filename. If you specify
the physical filename, you must enclose it in quotation marks.
Here are examples of
the INCLUDE command that illustrate the various ways that you can
specify physical files:
MYPGM is a fileref
that was previously associated with the external file.
PGM1 is a member of
the partitioned data set that is associated with the fileref MYPGM.
INCLUDE 'USERID.TEST.PGMS'
sequential data set
name.
INCLUDE 'USERID.TEST.PGMS(AAA)'
data set name with
member specified.
Assuming that the FILESYSTEM=
system option is set to MVS, SAS prepends this data set name with
the value of the SAS system option SYSPREF=, which defaults to the
system prefix. If FILESYSTEM=HFS, SAS looks into your default UNIX
file system directory for the “hidden” file .TEST.MYPGM.
INCLUDE 'UFS:/u/userid/mypgms/mypgm1.c'
name of a UNIX System
Services file in the hierarchical file system, represented by a partially
qualified path. SAS searches for the file in the default UFS directory
for that user. If the FILESYSTEM= system option was set to HFS and
if MYPGM was a standard
z/OS data set, the alternate syntax of
MVS:
would
be required above. For more information, see
FILESYSTEM= System Option: z/OS.
INCLUDE 'pgms/mypgms/mypgm1.c'
This is another example
of a relative path to a UNIX System Services file. Any filename containing
a slash (/) is assumed to be in UNIX System Services, regardless of
the value of the FILESYSTEM= system option.
The * wildcard character
specifies a concatenation of UNIX System Services files, which in
this case, includes all of the files in the directory MYPGM. For more
information about the use of the wildcard character, see
Concatenating UNIX System Services Files.
Use the ENCODING= option
to dynamically change the character-set encoding for processing external
data. When data is read into SAS, it is changed from the specified
encoding to the session encoding. For a list of valid encoding values,
see “ENCODING System Option” in the
SAS System Options: Reference.