Working with locales

Locales are used primarily in ILE-based application programs. Additionally, the Retrieve Locale Information (OPM, QLGRTVLC; ILE, QlgRetrieveLocaleInformation) API retrieves one or all categories of a locale.

Benefits of using locales in global applications

Applications can be created independent of language, cultural data, or specific characters. Locales can be accessed to provide this type of support to any integrated language environment-based application.

For example, the LC_TIME category within a locale can be defined in any of the following ways, or in any combination that is convenient for the environment in which the application runs:

  • HH:MM:SS
  • MM:SS:HH
  • SS:MM:HH

Creating locales

Locales are created using the Create Locale (CRTLOCALE) command. The source file used to create the locale is named QLOCALESRC, in the QSYSLOCALE library. This library is loaded with option 21 of the operating system. These source files cannot be changed. Instead, they must be copied and then edited if changes are required.