Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

User-specific locales

&pagelevel(3)&pagelevel

Users can define their own locales.

The CRTE library SYSLNK.CRTE provides two source program elements (type S) with the names USLOCC and USLOCA for this purpose.
USLOCC is a C source program, USLOCA is an Assembler source program. The two source programs are equally effective at generating user-specific locales.

The source programs define the data for the individual locale categories and are preset with the data of the C locale. The structure of this data is described below. The data can be changed to the desired values.

The following modification must also be made in the source programs:

An address table with the name USERLOC is defined in the source programs. This name must be changed to one selected by the user. It must be a valid entry name.

In the C source program, only the name USERLOC need be modified with a #define statement. In the Assembler source program, the name USERLOC must be modified in the definition line of the table and in the ENTRY statement.

The name modified by the user is used when the setlocale library function is called to identify the user-specific locale (as a string in the second parameter).

The modified source programs can be compiled or assembled with the C/C++ compiler or with the Assembler (also ASSGEN).
If the module is not stored in the library SYSLNK.CRTE but in another PLAM library, this library must be assigned with the following SET-FILE-LINK command before the C program is started:

/ADD-FILE-LINK LINK-NAME=IC@LOCAL,FILE-NAME=library

Structure of the data for the various locale categories

LC_COLLATE

The sort sequence is determined by a table (COLL/uscol) which defines the sort rating of each character by means of a weighting. The initial values are the characters’ own hexadecimal values, i.e. the sort sequence corresponds to the EBCDIC sequence.

LC_CTYPE

There are three tables which define the classification and the conversion from uppercase to lowercase and vice versa for all EBCDIC characters.

The classification table (TYPE/ustyp) assigns each EBCDIC character to a particular character class. The classes are represented by the following values:

                   Assembler program    C program
Uppercase letter           X'01'             _U
Lowercase letter           X'02'             _L
Decimal digit              X'04'             _N
Space                      X'08'             _S
Special character          X'10'             _P
Control character          X'20'             _C
Hexadecimal character      X'40'             _X

The C values are defined in the include file <ctype.h>.

The tables for converting from uppercase to lowercase letters (LOWER/uslow) and from lowercase to uppercase letters (UPPER/usupp) indicate the character resulting from conversion for each character from X’00’ to X’FF’. These tables are used by the toupper and tolower macros for converting to uppercase and lowercase letters. The table needs to be filled only for characters which are classified as uppercase or lowercase letters in the classification table.

LC_NUMERIC, LC_MONETARY

A string with a maximum of 8 characters is provided for all information of type char *. These strings must always be terminated with a null byte.

LC_TIME

Strings with a maximum of 12 characters are provided for the days of the week and the months of the year.