Specifying a Locale

How Locale Is Specified at SAS Invocation

You can use the LOCALE= system option to specify the locale of the SAS session at SAS invocation. LOCALE= also implicitly sets the following SAS system options:
  • DATESTYLE=
  • DFLANG=
  • ENCODING=
  • PAPERSIZE=
  • TRANTAB=
Windows example:
sas9 -locale English_UnitedStates
Note: Locale can also be specified using POSIX naming standards. For example, en_US is the POSIX equivalent for the SAS value English_UnitedStates.
Default values for the LOCALE= option are the same under each operating environment. For details, see LOCALE= Values and Default Settings for ENCODING, PAPERSIZE, DFLANG, and DATESTYLE Options.
The English_UnitedStates value for LOCALE= causes the following options to be implicitly set to the specified default values SAS invocation:
  • DATESTYLE=MDY
  • DFLANG=English
  • ENCODING=wlatin1
  • PAPERSIZE=Letter
  • TRANTAB=(lat1lat1, lat1lat1,wlt1_ucs,wlt1_lcs,wlt1_ccl,,,)
At invocation, an explicitly set system option will override any implicitly set option.
Windows example:
sas9 -papersize=A4;
At invocation, the explicit setting PAPERSIZE=A4 will override an implicit setting of the PAPERSIZE= option via the LOCALE= option. For details, see PAPERSIZE= System Option.

How Locale Is Specified during a SAS Session

You can use the LOCALE= system option to specify the locale of the SAS session during the SAS session. However, only the values for these system options will change implicitly to reflect the changed value of LOCALE=:
  • DATESTYLE=
  • DFLANG=
  • PAPERSIZE=
The values for these system options will not change implicitly to reflect the changed value of LOCALE=:
  • ENCODING=
  • TRANTAB=
Note: ENCODING= cannot be reset during a SAS session. It can be set only at invocation.
Note: For more details about the differences between the LOCALE= and ENCODING= options, see Setting the Encoding of a SAS Session.
Windows example:
options locale=Italian_Italy;
The Italian_Italy value that is assigned to the LOCALE= option causes the following options to be implicitly reset during the SAS session to reflect the changed value of the LOCALE= system option:
  • DATESTYLE=DMY
  • DFLANG=Italian
  • PAPERSIZE=A4
The values for the ENCODING= and TRANTAB= options will not be reset; their former values will be retained.
For details about these system options, see DATESTYLE= System Option.

Language Switching

SAS messages are displayed in the language that is specified by the settings in the SAS configuration file during start up. In the Unicode server, you can view SAS messages in another language by using the Language Switching feature. You can access the Language Switching feature with the LOCALELANGCHG system option. If LOCALELANGCHG is enabled, then the value of the LOCALE system option determines the language for procedure output, user interface elements and ODS fonts. If LOCALELANGCHG is disabled, then messages will appear in the language that is set during start up. This feature is supported in the Unicode server. For more information, see the LOCALELANGCHG System Option.