INENCODING= and OUTENCODING= Options

Overrides and changes the encoding when reading or writing SAS data sets in the SAS library.
Valid in: LIBNAME statement
Category: Data Access

Syntax

INENCODING= ANY | ASCIIANY | EBCDICANY | encoding-value
OUTENCODING= ANY | ASCIIANY | EBCDICANY | encoding-value

Syntax Description

ANY
specifies no transcoding between ASCII and EBCDIC encodings.
NOTE: ANY is a synonym for binary. Because the data is binary, the actual encoding is irrelevant.
ASCIIANY
specifies that no transcoding occurs, assuming that the mixed encodings are ASCII encodings.
EBCDICANY
specifies that no transcoding occurs, assuming that the mixed encodings are EBCDIC encodings.
encoding-value
specifies an encoding value. For a list of encoding values, see Encoding Values for a SAS Session.

Details

The INENCODING= option is used to read SAS data sets in the SAS library. The OUTENCODING= option is used to write SAS data sets in the SAS library.
The INENCODING= or the OUTENCODING= value is written to the SAS log when you use the LIST argument.
INENCODING= and OUTENCODING= are most appropriate when using an existing library that contains mixed encodings. To read a library that contains mixed encodings, you can set INENCODING= to ASCIIANY or EBCDICANY. To write a separate data set, you can use OUTENCODING= to specify a specific encoding, which is applied to the data set when it is created.

Comparisons

  • Session encoding is specified using the ENCODING= system option or the LOCALE= system option. Each operating environment has a default encoding.
  • You can specify the encoding for reading data sets in a SAS library by using the LIBNAME statement INENCODING= option for input files. If both the LIBNAME statement option and the ENCODING= data set option are specified, SAS uses the data set option.
  • You can specify the encoding for writing data sets to a SAS library by using the LIBNAME statement OUTENCODING= option for output files. If both the LIBNAME statement option and the ENCODING= data set option are specified, SAS uses the data set option.
  • For the COPY procedure, the default CLONE option uses the encoding attribute of the input data set instead of the encoding value specified on the OUTENCODING= option. For more information about CLONE and NOCLONE, see COPY Statement.
    Note: This interaction does not apply when using SAS/CONNECT or SAS/SHARE.

See Also

Statements:
LIBNAME Statement in SAS Statements: Reference
Data Set Options: