ENCODING System Option: UNIX, Windows, and z/OS

Specifies the default character-set encoding for the SAS session.
Valid in: configuration file, SAS invocation
Category: Environment control: Language control
PROC OPTIONS GROUP= LANGUAGECONTROL
OpenVMS specifics: latin1
z/OS specifics: OPEN_ED-1047
Windows specifics: wlatin1

Syntax

-ENCODING= ASCIIANY | EBCDICANY | encoding-value (UNIX and Windows)
ENCODING= encoding-value (UNIX, Windows, and z/OS)

Required Arguments

ASCIIANY
Transcoding normally occurs when SAS detects that the session encoding and data set encoding are different. ASCIIANY enables you to create a data set that SAS will not transcode if the SAS session that accesses the data set has a session that encoding value of ASCII. If you transfer the data set to a machine that uses EBCDIC encoding, transcoding occurs.
Note: ANY is a synonym for binary. Because the data is binary, the actual encoding is irrelevant.
EBCDICANY
is valid only for z/OS. Transcoding normally occurs when SAS detects that the session encoding and the data set encoding are different. EBCDICANY enables you to create a data set that SAS will not transcode if the SAS session accessing the data set has a session encoding value of EBCDIC. If you transfer the data set to a machine that uses ASCII encoding, transcoding occurs.
encoding-value
For valid values for all operating environments, see Encoding Values for a SAS Session.

Details

A character-set encoding is a set of characters that have been mapped to numeric values called code points.
The encoding for a SAS session is determined by the values of the ENCODING=, LOCALE=, DBCSTYPE=, and DBCSLANG= system options as follows:
  • If the ENCODING= and LOCALE= system options are not specified, the default value is ENCODING=. For UNIX, the default value is latin1; for Windows, the default value is wlatin1; for z/OS, the default is OPEN_ED-1047.
  • If the ENCODING option is not specified, the value of Encoding is determined by the value of LOCALE and the operating system where SAS is running. Also, if LOCALE is not set, the default LOCALE is en_US.
  • If both LOCALE= and ENCODING= are specified, the session encoding is the value that is specified by the ENCODING= option.
  • If LOCALE= is specified and ENCODING= is not specified, SAS infers the appropriate encoding value from the LOCALE= value.
  • If the DBCS option is set, the values for the DBCSLANG= and DBCSTYPE= system options determine the ENCODING= and LOCALE= values.