ILE COBOL Language Reference

+-------------------------------IBM Extension--------------------------------+

Format 8 - Locale

Format 8 of the SET statement allows you to set and query the locale categories of the current locale. A locale is a system object containing language and cultural information. For example, a locale contains the appropriate format for a date or time in a particular region of the world. The information in a locale is divided into locale categories. For example, locale category LC_TIME contains information about date and time formats. For each run unit there is a DEFAULT locale, a current locale, and from zero to many specific locales. The current locale is altered by setting some or all of its locale categories to the DEFAULT or a specific locale. The name of the specific locale to which a locale category (of the current locale) was set can be placed into an identifier. The contents of a locale category can be changed by setting the locale category from:

Each locale category specified remains in effect for the duration of the run unit or until another SET statement specifying the category is processed.

Set Statement - Format 8
 
                .-----------------.
                V                 |
>>-SET--LOCALE----+-LC_ALL------+-+----------------------------->
                  +-LC_COLLATE--+
                  +-LC_CTYPE----+
                  +-LC_MESSAGES-+
                  +-LC_MONETARY-+
                  +-LC_NUMERIC--+
                  +-LC_TIME-----+
                  '-LC_TOD------'
 
>--+---------------------------------------------------------+-->
   '-INTO--identifier-10--+--------------------------------+-'
                          '-+----+--LIBRARY--identifier-11-'
                            '-IN-'
 
>--+-------------------------------------------------------------+-><
   '-FROM--+-DEFAULT-------------------------------------------+-'
           +-identifier-12--+--------------------------------+-+
           |                '-+----+--LIBRARY--identifier-13-' |
           |                  '-IN-'                           |
           '-mnemonic-name-2-----------------------------------'
 
 
LC_ALL
Locale categories LC_COLLATE, LC_CTYPE, LC_MESSAGES, LC_MONETARY, LC_NUMERIC, LC_TIME, and LC_TOD, as well as any other categories included in the locale.
LC_COLLATE
The locale category that defines collation sequence.
LC_CTYPE
The locale category that defines character classification and character type.
LC_MESSAGES
The locale category that defines formatting of informative and diagnostic messages, and interactive responses.
LC_MONETARY
The locale category that defines monetary formatting.
LC_NUMERIC
The locale category that defines numeric formatting.
LC_TIME
The locale category that defines date and time formatting.
LC_TOD
The locale category that defines definitions of time zone differences, time zone names, and Daylight Saving Time start and end points.
identifier-10
The value of identifier-10 references a locale-category. Identifier-10 must be an elementary alphanumeric data item. If the INTO phrase is specified, the identification of the current locale for the specified category is stored in the data item referenced by identifier-10. The INTO phrase is processed before the FROM phrase, using the rules of the MOVE statement for an alphanumeric-to-alphanumeric move.
DEFAULT
Sets the locale category to the current default. The default locale exists at the time a run unit is activated, and remains the default for the duration of the run unit. The default locale also becomes the current locale at the time a run unit is activated, and remains the current locale until it is switched using Format 8 of the SET statement.
identifier-12
The value of identifier-10 references a locale-category. Identifier-12 must reference an elementary alphanumeric data item. If the locale specified in identifier-12 is not available, an operating system escape message is issued. If the FROM phrase is specified, the current locale for the specified category is set to the content of the data item referenced by identifier-12. The identification of the current locale is stored using the rules of the MOVE statement for an alphanumeric-to-alphanumeric move.
mnemonic-name-2
If the locale specified in mnemonic-name-2 is not available, an operating system escape message is issued. If the FROM phrase is specified, the current locale for the specified category is set to the locale category identified by mnemonic-name-2.

IN LIBRARY Phrase

The IN LIBRARY phrase is used to specify the library where the locale object exists. For the INTO clause, identifier-11 is updated with the library name for the specified locale category. For the FROM clause, identifier-12 is used to locate the locale object that the locale category will be set to.

identifier-11, identifier-13
Must be an elementary alphanumeric data item. The contents of identifier-11 or identifier-13 must represent a valid library name. library names are at most 10 characters long; the first 10 characters of identifier-2 are used to form the library name.

If identifier-13 is not specified, a library of *LIBL is assumed. Otherwise, identifier-13 must contain the library where the locale object name, specified in identifier-12, exists. If identifier-11 is specified, it will contain the library name of the locale object to which the current locale category was last set. If the locale name in identifier-10 is DEFAULT, identifier-11 will be set to spaces.

Identifier-11 and identifier-13 are not affected by the *MONOPRC compiler option, and can contain an extended name.

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]