Your locale objects must be made available to your program before
they can be used. For PDS and PDSE resident locales, your load library
must be included in your program search order. For resident locales
in the z/OS UNIX file system, do one of the following:
- Copy your locales into the system default locale object directory
/usr/lib/nls/locale.
- Update your LOCPATH environment variable to include
the directory containing your locales.
For example, assume that the
CCNGCL1 program has been
compiled with LP64 into a UNIX file system executable called
getlocname.
Further assume that you have generated non-XPLINK, XPLINK and
AMODE 64 UNIX
file system resident versions of the
TEXAN locale into
your current directory. The following commands make
TEXAN available
to non-XPLINK, XPLINK and
AMODE 64 applications:
$ ls
TEXAN.IBM-1047 TEXAN.IBM-1047.xplink TEXAN.IBM-1047.lp64 getlocname
$ export LOCPATH=$PWD
$ export LC_ALL=TEXAN.IBM-1047
$ getlocname
Default NULL locale = C
Default "" locale = /u/marcw/TEXAN.IBM-1047.lp64
$
If
getlocname was compiled non-XPLINK then the output
would look like the following:
$ getlocname
Default NULL locale = C
Default "" locale = /u/marcw/TEXAN.IBM-1047
$
If
getlocname was compiled XPLINK then the output
would look like the following:
$ getlocname
Default NULL locale = C
Default "" locale = /u/marcw/TEXAN.IBM-1047.xplink
$
The customized locale is now ready to be used in these ways:
- Explicitly referenced by name in z/OS® XL C/C++ application code that
uses setlocale() calls referring to the locale descriptive name (recommended)
such as:
setlocale(LC_ALL, "TEXAN.IBM-1047");
or by a short
internal name (not recommended) such as:
setlocale(LC_ALL, "1TEY");
- Explicitly referenced in the z/OS XL C/C++ initialization exit, using
customized setup code in CEEBINT.
- Implicitly specified in each user environment with environment
variables.
Note: You cannot customize the built-in locales, C, POSIX, SAA,
or S370. The locale source files EDC$POSX and EDC$SAAC are
provided for reference only.