Globalization enables you to work in a cultural context
that is
comfortable for you through locales, character sets, and a number
of special environment variables. The process of adapting an internationalized
application or program, particular to a language or cultural milieu,
is termed localization.
A
locale is the subset of your environment that deals with
language and cultural conventions.
When specifying
a locale, the convention is to use the descriptive locale name. See
the section on locale naming conventions in z/OS XL C/C++ Programming Guide. It
is made up of a number of categories, each of which is associated
with an environment variable and controls a specific aspect of the
environment. The following list shows the categories and their spheres
of influence:
- LC_COLLATE
- Collating
(sorting) order.
- LC_CTYPE
- Character
classification and case conversion.
- LC_MESSAGES
- Formats
of informative and diagnostic messages and interactive responses.
- LC_MONETARY
- Monetary
formatting.
- LC_NUMERIC
- Numeric,
nonmonetary formatting.
- LC_TIME
- Date and time
formats.
- LC_SYNTAX
- EBCDIC-variant
character encodings used by some C functions and utilities.
To give a locale control over a category, set the corresponding
variable to
the name of the locale. In addition to the environment variables associated
with the categories, there are two other variables which are used
in conjunction with localization,
LANG and
LC_ALL. All
of these variables affect the performance of the shell commands. The
general effects apply to most commands, but certain commands such
as
sort, with its dependence on
LC_COLLATE,
require special attention to be paid to one or more of the variables.
This; this section discusses such cases in the
Localization topic
of the command. The effects of each environment variable is as follows:
- LANG
- Determines the
international language value. Utilities and applications can use the
information from the given locale to provide error messages and instructions
in that locale's language. If LC_ALL variable is not defined,
any undefined variable is treated as though it contained the value
of LANG.
- LC_ALL
- Overrides the
value of LANG and the values of any of the other variables
starting with LC_.
- LC_COLLATE
- Identifies the locale that controls the collating (sorting) order
of characters and determines the behavior of ranges, equivalence classes,
and multicharacter collating elements.
- LC_CTYPE
- Identifies the locale that defines character classes (for example, alpha,
digit, blank) and their behavior (for example, the mapping of
lowercase letters to uppercase letters). This locale also determines
the interpretation of sequences of bytes as characters (such as single-byte
versus double-byte characters).
- LC_MESSAGES
- Identifies the locale that controls the processing of affirmative
and negative responses. This locale also defines the language and
cultural conventions used when writing messages.
- LC_MONETARY
- Determines the locale that controls monetary-related numeric formatting
(for example, currency symbol, decimal point character, and thousands
separator).
- LC_NUMERIC
- Determines the locale that controls numeric formatting (for example,
decimal point character and thousands separator).
- LC_TIME
- Identifies the locale that determines the format of time and date
strings.
- LC_SYNTAX
- Identifies the locale that defines the encodings for the variant
characters in the portable character set.
The NLSPATH localization variable specifies where
the message catalogs are to be found.
For example,
NLSPATH="/system/nlslib/%N.cat"
specifies
that the
z/OS shell is
to look for all message catalogs in the directory
/system/nlslib,
where the catalog name is to be constructed from the
name parameter
passed to the
z/OS shell with
the suffix
.cat.
Substitution fields consist of a % symbol, followed by a single-letter
keyword. These keywords are currently defined:
- %N
- The value of the name parameter
- %L
- The value of the LC_MESSAGES category, or LANG,
depending on how the catopen() function that opens this catalog is
coded. For more information, see catopen() in z/OS XL C/C++ Runtime Library Reference.
- %l
- The language element from the LC_MESSAGES category
- %t
- The territory element from the LC_MESSAGES category
- %c
- The codeset element from the LC_MESSAGES category
Templates defined in
NLSPATH are separated
by colons (:). A leading colon or two adjacent colons (::) are equivalent
to specifying
%N. For example:
NLSPATH=":%N.cat:/nlslib/%L/%N.cat"
specifies
that the
z/OS shell should
look for the requested message catalog in
name,
name.cat,
and
/nlslib/
category/
name.cat,
where
category is the value of the
LC_MESSAGES or
LANG category
of the current locale.
Do not set the NLSPATH variable unless you need to override
the default system path. Otherwise the commands might behave unpredictably.