Setting an Active Locale for an Application

All C and C++ applications using locales of type *LOCALE have an active locale which is scoped to the activation group of the program. The active locale determines the behavior of the locale-sensitive functions in the C library. The active locale can be set explicitly with a call to setlocale(). See the ILE C/C++ Runtime Library Functions for more information on using setlocale().

If the active locale is not set explicitly by a call to setlocale(), it is implicitly set by the C runtime environment at program activation time. Here is how the runtime environment sets the active locale when a program is activated:
  • If the user profile has a value for the LOCALE parameter other than *NONE (the default) or *SYSVAL, that value is used for the application's active locale.
  • If the value of the LOCALE parameter in the user profile is *NONE, the default "C" locale becomes the active locale.
  • If the value of the LOCALE parameter in the user profile is *SYSVAL, the locale associated with the system value QLOCALE will be used for the program's active locale.
  • If the value of QLOCALE is *NONE, the default "C" locale becomes the active locale.