This example contains the steps necessary for creating a locale. The example also shows how to enable the locale.
Steps for enabling the locale are:
The library and source physical file are needed to store the locale source file member. The System-supplied locale source definition files topic includes a list of the locale source file members that are included in i5/OS™.
There is now a library called localelib.
Next, create a source physical file.
There is now a source physical file (localesrc) created in library localelib.
IBM-supplied locale source definition file members are located in library QSYSLOCALE, source physical file QLOCALESRC. See System-supplied locale source definition files for a list of all IBM-supplied locale source files. In this example, member EN_US, a locale for the English language, is copied.
+--------------------------------------------------------------------------------+ |Copy File (CPYF) | | | |Type choices, press Enter. | | | |From file . . . . . . . . . . . QLOCALESRC Name | |Library . . . . . . . . . . . QSYSLOCALE Name, *LIBL,*CURLIB | |To file . . . . . . . . . . . . LOCALESRC_ Name, *PRINT | |Library . . . . . . . . . . . LOCALELIB_ Name, *LIBL,*CURLIB | |From member . . . . . . . . . . EN_US Name, generic*,*FIRST, *ALL | |To member or label . . . . . . . EN_US_____ Name, *FIRST,*FROMMBR | |Replace or add records . . . . . *ADD____ *NONE, *ADD,*REPLACE | |Create file . . . . . . . . . . *YES *NO, *YES | |Record format field mapping . . *MAP__ *NONE, *NOCHK,*CVTSRC | +--------------------------------------------------------------------------------+
The values entered copy the EN_US member to the source physical file localesrc in library localelib.
If you want to use the IBM-supplied locale as it is included, you do not need to change it. You can go to the next step, create the locale object. However, in this example we will edit the EN_US member to set the time-of-day keywords used in the LC_TOD category.
In this example, Source Entry Utility (SEU) is used to edit the locale. You can use SEU or an equivalent editor.
+--------------------------------------------------------------------------------+ |Start Source Entry Utility (STRSEU) | | | |Type choices, press Enter. | | | |Source file . . . . . . . . . . localesrc Name, *PRV | |Library . . . . . . . . . . . localelib_ Name, *LIBL, *CURLIB, *PRV | |Source member . . . . . . . . . EN_US_____ Name, *PRV, *SELECT | +--------------------------------------------------------------------------------+
+--------------------------------------------------------------------------------+ |COLUMNS . . . : 1 71 EDIT LOCALELIB/LOCALESRC | |SEU==> F_LC_TOD EN_US | |FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+...6 ...+... 7 | |*************** BEGINNING OF DATA************************************* | |5967.00 comment_char <percent-sign> | |5968.00 escape_char <slash> | |5969.00 | |5970.00 % | |5971.00 % 5716SS1 (C) COPYRIGHT IBM CORP. 1991,1996 | |5972.00 % ALL RIGHTS RESERVED. | |5973.00 % US GOVERNMENT USERS RESTRICTED RIGHTS - | |5974.00 % USE, DUPLICATION OR DISCLOSURE RESTRICTED | |5975.00 % BY GSA ADP SCHEDULE CONTRACT WITH IBM CORP. | |5976.00 % | |5977.00 % LICENSED MATERIALS-PROPERTY OF IBM | |5978.00 % | |5979.00 % FILE NAME : EN_US | |5980.00 % | |5981.00 % COUNTRY/REGION: UNITED STATES | |5982.00 % | | | |F3=EXIT F4=PROMPT F5=REFRESH F9=RETRIEVE F10=CURSOR F11=TOGGLE | |F16=REPEAT FIND F17=REPEAT CHANGE F24=MORE KEYS | | (C) COPYRIGHT IBM CORP.1981, 1996. | +--------------------------------------------------------------------------------+
As you can see, all LC_TOD category keywords have values of 0 and no descriptive names declared for tname and dstname.
+--------------------------------------------------------------------------------+ |COLUMNS . . . : 1 71 EDIT LOCALELIB/LOCALESRC | |SEU==> EN_US | |FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+...6 ...+... 7 | |6519.00 | |6520.00 LC_TOD | |6521.00 | |6522.00 tzdiff 0 | |6523.00 tname "" | |6524.00 dstname "" | |6525.00 dststart 0,0,0,0 | |6526.00 dstend 0,0,0,0 | |6527.00 dstshift 0 | |6528.00 | |6529.00 END LC_TOD | |****************** END OF DATA**************************************** | | | | | | | | | | | | | |F3=EXIT F4=PROMPT F5=REFRESH F9=RETRIEVE F10=CURSOR F11=TOGGLE | |F16=REPEAT FIND F17=REPEAT CHANGE F24=MORE KEYS | |STRING LC_TOD FOUND. | +--------------------------------------------------------------------------------+
The SEU edit screen should match the screen below.
+--------------------------------------------------------------------------------+ |COLUMNS . . . : 1 71 EDIT LOCALELIB/LOCALESRC | |SEU==> EN_US | |FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+...6 ...+... 7 | |6519.00 | |6520.00 LC_TOD | |6521.00 | |6522.00 tzdiff 360 | |6523.00 tname "<C><E><N><T><R><A><L>" | |6524.00 dstname "<C><D><T>" | |6525.00 dststart 4,0,23,0 | |6526.00 dstend 10,3,6,0 | |6527.00 dstshift 3600 | |6528.00 | |6529.00 END LC_TOD | |****************** END OF DATA **************************************** | | | | | | | | | | | | | |F3=EXIT F4=PROMPT F5=REFRESH F9=RETRIEVE F10=CURSOR F11=TOGGLE | |F16=REPEAT FIND F17=REPEAT CHANGE F24=MORE KEYS | |STRING LC_TOD FOUND. | +--------------------------------------------------------------------------------+
You have now copied the IBM-supplied locale source member and customized the LC_TOD category.
+--------------------------------------------------------------------------------+ |Create Locale (CRTLOCALE) | | | |Type choices, press Enter. | | | |Locale name . . . . . . . . . . > '/qsys.lib/localelib.lib/en_us.locale'____ | |______ | |Source file path name . . . . . > '/qsys.lib/localelib.lib/localesrc.file/en | |_us.mbr' | |Coded character set ID . . . . . > 37________ 1-65533, *JOB | |Generation severity level . . . 10____ 10, 20 | |Text 'description' . . . . . . . my version of locale EN_US - contains my c | |hanges_ | | | | | | | | | | | | | | | |Bottom | |F3=Exit F4=Prompt F5=Refresh F10=Additional parameters F12=Cancel | |F13=How to use this display F24=More keys | | | | | +--------------------------------------------------------------------------------+
Locales can be enabled system-wide using the QLOCALE system value or for individual users by changing their user profile. To enable system-wide, make EN_US the value for QLOCALE. In this example locale support is enabled for one user.
In the following portion of the Change User Profile display, the LOCALE parameter now has a value indicating that EN_US is the specified locale to be used by your userid.
+--------------------------------------------------------------------------------+ |+ for more values | |Locale . . . . . . . . . . . . . QSYS.LIB/LOCALELIB.LIB/EN_US.LOCALE______ | |_______ | +--------------------------------------------------------------------------------+
After your user profile has been changed, any jobs initiated by your userid have the EN_US locale associated with those jobs. The LANG environment variable is also initialized to the name of the locale.