ASCII is the foundation
for most encodings, and is used by most personal computers, minicomputers,
and workstations. However, the IBM mainframe uses an EBCDIC encoding.
Therefore, ASCII and EBCDIC machines and data are incompatible. Transcoding
is necessary if some or all characters in one encoding are different
from the characters in the other encoding.
However, to avoid transcoding,
you can create a data set and specify an encoding value that SAS will
not transcode. For example, if you use the following values in either
the ENCODING= data set option, or the INENCODING=, or the OUTENCODING=
option in the LIBNAME statement, transcoding is not performed:
-
ANY specifies that no transcoding
is desired, even between EBCDIC and ASCII encodings.
Note: ANY is a synonym for binary.
Because the data is binary, the actual encoding is irrelevant.
-
ASCIIANY enables you to create
a data set that is compatible with all ASCII-based encodings.
-
EBCDICANY enables you to create
a data set that is compatible with all EBCDIC-based encodings.
You might want to create
a SAS data set that contains mixed encodings. For example, both Latin1
and Latin2. You do not want the data transcoded for either input or
output processing. By default, data is transcoded to the current session
encoding.
Data must be transcoded
when the SAS file and the SAS session use incompatible encodings.For
example, ASCII and EBCDIC.
In some cases, transcoding
is not required because the SAS file and the SAS session have compatible
encodings.