Setting the Encoding of a SAS Session

You can set the session encoding by using the ENCODING= system option, the DBCS options, or the LOCALE= system option.
Note: Values for the ENCODING= system option depend on the operating environment.
The priority order for setting the encoding is as follows:
  1. ENCODING= system option
    The SAS session encoding is determined by the ENCODING= option regardless of whether the DBCS or LOCALE= options are specified. If the ENCODING= option is specified, a set of valid DBCS options are set regardless of whether the user has specified those options. Also, if the ENCODING= option is specified, the LOCALE= option is set to an appropriate value unless a value has been specified by the user.
    Note: If the ENCODING= option is specified, the TRANTAB= option is implicitly set.
  2. DBCS options
    Most North and South American and European users use the SAS SBCS environment and do not use the DBCS environment.
    If the ENCODING= option is not specified, the SAS session encoding is determined by the DBCS options regardless of whether the LOCALE= option is specified. The LOCALE= option is set to an appropriate value unless a value has been specified by the user.
    The encoding is determined by the values of the DBCSLANG and DBCSTYPE options for DBCS languages, such as Japanese, Korean, Simplified Chinese, and Traditional Chinese.
    The DBCS options are valid only when the DBCS extension directory is included in the path option list. The path of the DBCS extension dynamic link library (DLLs) has to be located at the top of the pathname list of the path option for the DBCS languages when you want to invoke a DBCS SAS session. The DBCS extension DLLs are located in the directory!SASROOT/dbcs/sasexe by default.
    Also you might have to specify the resourcesloc, msg, and sashelp options to use localized resources even if the SAS session encoding is not a DBCS language (for example, Polish, German, and French). The localized resources are located under!SASROOT/nls/<language identifier>/<sasmsg, sashelp, sasmacro, resource>. The values for language identifiers are: cs, de, en, es, fr, hu, it, ja, ko, pl, ru, sv, zh, and zt.
    You can specify a sasv9.cfg file located in the localized directories such as !SASROOT/nls/<language identifier> so that you do not have to consider using the path, resourcesloc, sasmsg, and sashelp options.
    If DBCS (which specifies that SAS process DBCS encodings) is specified, DBCSLANG= and DBCSTYPE= options are implicitly set. The default values for DBCSTYPE= and DBCSLANG= match those values for the DBCS environment on the host, for example, Japanese, Korean or Chinese.
  3. LOCALE= system option
    The SAS session encoding is determined by the LOCALE= option and the platform, if the ENCODING= or DBCS options are not specified.
    The following example shows that encoding is explicitly set by default for the Spanish_Spain locale:
    sas9 -locale Spanish_Spain
    The wlatin1 encoding is the default encoding for the Spanish_Spain locale.
    The following example shows that the wlatin2 encoding is set explicitly when SAS is invoked:
    sas9 -encoding wlatin2
    Note: Setting DBCS encodings, DBCS options, or a CJK (Chinese, Japanese, Korean) locale on SAS if the DBCS extensions are not available will fail to successfully invoke SAS.
    Note: Changing the encoding for a SAS session does not affect SAS keywords or SAS log output, which remain in English.
In Default Encoding Values Based on the LOCALE= Option, the following values for the CJK locales are based on locale and platform:
Default Encoding Values Based on the LOCALE= Option
Locales
WIN
MVS
UNX
zh_TW
zh_HK
zh_MO
MS-950 (ywin)
IBM-937 (yibm)
Solaris on X64, Solaris on SPARC, EUC-TW (yeuc)
others: MS-950 (ywin)
zh_CN
zh_SG
EUC-CN (zeuc)
IBM-935 (zibm)
EUC-CN (zeuc)
ja_JP
SHIFT-JIS (sjis)
IBM-939 (jibm)
IBM-930(j930)
h64, h6i, AIX on Power, SHIFT-JIS (sjis)
others: EUC-JP (jeuc)
ko_KR
EUC-KR (keuc)
IBM-933 (kibm)
EUC-KR (keuc)