You can change the session
encoding by using the LOCALE= system option, the ENCODING= system
option, or both. Note that valid values for both options are host
dependent.
Here is how you can
set the Base SAS (not SPD Server) session encoding when NONLSCOMPATMODE
is specified:
-
You can specify the LOCALE= system
option in a configuration file, at SAS invocation, in an OPTIONS statement,
or in the
SAS System Options window. In SAS
9, several NLS-related system options are automatically set, based
on the value of LOCALE=. Most customers will implicitly set encoding
with the LOCALE= system option.
-
You can specify the ENCODING= system
option in a configuration file or at SAS invocation.
-
Here is how LOCALE= and ENCODING=
interact:
-
If a value is not specified for
ENCODING= (that is, the installation default is set), then specifying
a value for LOCALE= sets the encoding based on the LOCALE= value.
In addition, values for the following system options are set based
on the LOCALE= value: DFLANG=, TRANTAB=, DATESTYLE=, and PAPERSIZE=.
-
If a value is specified for ENCODING=,
that value sets the session encoding and overrides LOCALE=.
-
If the value specified for LOCALE=
is not compatible with the value specified for ENCODING=, then the
value for LOCALE= is used. A warning message is provided if ENCODING=
and LOCALE= conflict.
-
If the DBCS system option is set,
which specifies that SAS process DBCS encodings, the values for DBCSLANG=
and DBCSTYPE= system options determine the session encoding and the
locale. These options are used for Asian languages or for English
with DBCS extensions.
Here is an example of
implicitly setting the Base SAS (not SPD Server) session encoding
based on the specified locale when you invoke SAS:
sas9 -explorer -locale spanish
Here is an example of
explicitly setting the Base SAS (not SPD Server) session encoding
with the OPTIONS statement:
options encoding=wlatin2;
Tip
Changing encoding for a SAS
session does not affect SAS keywords, which remain in English, or
SAS log output, which also remains in English.