Previous Page | Next Page

Windows and Commands in z/OS Environments

INCLUDE Command: z/OS



Copies the entire contents of an external file into the current window.
z/OS specifics: file-specification

Syntax
Details
See Also

Syntax

INCLUDE fileref
INCLUDE fileref(member)
INCLUDE 'physical-filename' <ENCODING=encoding-value>
INCLUDE 'physical-filename(member)' <ENCODING=encoding-value>

ENCODING=encoding-value

specifies the encoding to use when reading to the input file. Typically, you would specify a value for ENCODING= that indicates that the input file has a different encoding from the current session encoding. However, you can also specify the same encoding for the input file as for the current session encoding. You must enclose the value in quotation marks if it contains a dash.

If you specify an encoding value that is different from the session encoding, SAS transcodes the data from the specified encoding to the session encoding when you read data from the input file. The default encoding is the session encoding, which is the value of the ENCODING= SAS system option.

For valid encoding values and for more information about encoding, see "Encoding Values in SAS Language Elements" in the SAS National Language Support (NLS): Reference Guide.


Details

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 you can specify physical files:

INCLUDE MYPGM

MYPGM is a fileref that was previously associated with the external file.

INCLUDE MYPGM(PGM1)

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.

INCLUDE '.TEST.MYPGM'

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 (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.

INCLUDE 'pgms/mypgms/*'

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 SAS Language Reference: Dictionary.


See Also

Previous Page | Next Page | Top of Page