|
CEE3LNG
sets the current national language. You can also use CEE3LNG to query
the current national language. Changing the national language changes
the languages in which error messages are displayed and printed, the
names of the days of the week, and the names of the months. The current
national language setting, as well as previous national language settings
that have not been discarded, are recorded on the stack on a LIFO
(last in, first out) basis. The current national language setting
is always on the top of the stack.
There are two methods of
changing the default national language setting with CEE3LNG: - Specify the new national language setting and place it on top
of the stack using a function value of 1
(SET). This discards the previous default setting.
- Specify the new national language setting and place it on top
of the stack using a function value of 3
(PUSH). This pushes the previous national language setting down on
the stack so that you can later retrieve it by discarding the current
setting.
To illustrate
the second method, suppose you live in the United States and the code
for the United States is specified as a system-level default. If
you want to use the French defaults for a certain application, you
can use CEE3LNG to PUSH France as the national
language setting; then when you want the defaults for the United States,
you can POP France from the top of the stack, making the United States
the national language setting.
If you specify a desired_language that
is not available on your system, Language Environment uses
the IBM-supplied default ENU (mixed-case U.S. English). If an unknown
national language code is specified as a system-level, region-level
or CEEUOPT default, a return code of 4 and a warning message is issued.
You
can also use the NATLANG runtime option to set the national language.
CEE3LNG
affects only the Language Environment NLS and
date and time services, not the Language Environment locale
callable services or C locale-sensitive
functions.
Syntax
>>-CEE3LNG--(--function--,--desired_language--,--fc--)---------><
- function (input)
- A fullword binary integer that specifies the service to perform.
The possible values for function are:
- 1—SET
- Establishes the desired_language specified
in the call to CEE3LNG as the current language. In effect, it replaces
the current language on the top of the stack with the desired_language that
you specify. When setting the national language, the desired_language is
folded to uppercase. "enu" and "ENU", for example, are considered
to be the same national language.
- 2—QUERY
- Identifies the
current language on the top of the stack to the calling routine by
returning it in the desired_language parameter
of CEE3LNG. The desired_language retained
as the result of the QUERY function is in uppercase.
- 3—PUSH
- Pushes the desired_language specified
in the call to CEE3LNG on to the top of the
language stack, making it the current language. Previous languages
are retained on the stack on a LIFO basis, making it possible to return
to a prior language at a later time.
- 4—POP
- Pops the current language off the stack. The
previous language that was pushed on to the stack now becomes the
new current language. Upon return to the caller, the desired_language parameter
contains the discarded language. If the stack contains only one language
and would be empty after the call, no action is taken and a feedback
code indicating such is returned.
- desired_language (input/output)
- A 3-character fixed-length string. The string is not case-sensitive
and is used in the following ways for different functions:
If function is: |
Then desired_language: |
---|
1 or 3 |
Contains the desired national language identification. In this
case, it is an input parameter. Table 1 contains
a list of national language identifiers. Note: Language Environment supports
only these national languages: - ENU
- Mixed-case U.S. English
- UEN
- Uppercase U.S. English
- JPN
- Japanese.
|
2 |
Returns the current language on top of the stack. In this case,
it is an output parameter. |
4 |
Returns the discarded national language. In this case, it is
an output parameter. |
- fc (output)
- A 12-byte feedback code, optional in some languages,
that indicates the result of this service. If you choose to omit this
parameter, refer to Invoking callable services for the
appropriate syntax to indicate that the feedback code was omitted.
The
following symbolic conditions can result from this service:
Code |
Severity |
Message number |
Message text |
---|
CEE000 |
0 |
— |
The service completed successfully. |
CEE3BQ |
2 |
3450 |
Only one language was on the stack when a POP request was made
to CEE3LNG. The current language was returned. |
CEE3BR |
3 |
3451 |
The desired language desired-language for
the PUSH or SET function for CEE3LNG was invalid. No operation was
performed. |
CEE3BS |
3 |
3452 |
The function function specified for CEE3LNG
was not recognized. No operation was performed. |
Usage notes - PL/I MTF
consideration—The CEE3LNG callable service is not supported in PL/I multitasking
applications.
- PL/I consideration—When
running PL/I with
POSIX(ON), CEE3LNG is not supported.
- z/OS UNIX consideration
- CEE3LNG applies to the enclave. Each enclave has a single current
national language setting.
- Language Environment provides z/OS UNIX-compliant
locales as part of the C/C++ runtime library. The locales establish
the cultural conventions for locale-sensitive functions in this runtime.
The CEESETL callable service and other locale callable services depend
on the loaded locale. To change the locale, you can use the setlocale() C/C++
library function or the CEESETL callable service. Locale values do
not affect the settings used by the CEE3LNG callable service. For
a complete list of locales, see z/OS Language Environment Programming Guide.
- The CEE3LNG callable services, such as date and time formatting,
sorting, and currency symbols are independent of the locale. CEE3LNG
affects only Language Environment NLS
and date and time services. Mixing CEE3LNG services and locale callable
services might produce inconsistent results.
Examples - Following is an example of CEE3LNG called by C/C++.
/*Module/File Name: EDC3LNG */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <leawi.h>
#include <ceeedcct.h>
int main(void) {
_FEEDBACK fc;
_INT4 function;
_CHAR3 lang;
/* Query the current language setting */
function = 2; /* function 2 is query */
CEE3LNG(&function,lang,&fc);
if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
printf("CEE3LNG failed with message number %d\n",
fc.tok_msgno);
exit(2999);
}
/* if the current language is not mixed-case */
/* American English set the current language to */
/* mixed-case American English */
if (memcmp(lang,"ENU",3) != 0) {
memcpy(lang,"ENU",3);
function = 1; /* function 1 is set */
CEE3LNG(&function,lang,&fc);
if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
printf("CEE3LNG failed with message number %d\n",
fc.tok_msgno);
exit(2999);
}
}
}
- Following is an example of CEE3LNG called by COBOL.
CBL LIB,QUOTE
*Module/File Name: IGZT3LNG
*************************************************
** **
** CBL3LNG - Set national language **
** **
** In this example, CEE3LNG is called to query **
** the current national language setting. If **
** the setting is not mixed-case U.S. English, **
** CEE3LNG is called to change the setting. **
** **
*************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. CBL3LNG.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 FUNCTN PIC S9(9) BINARY.
01 LANG PIC X(3).
01 FC.
02 Condition-Token-Value.
COPY CEEIGZCT.
03 Case-1-Condition-ID.
04 Severity PIC S9(4) BINARY.
04 Msg-No PIC S9(4) BINARY. 03
Case-2-Condition-ID
REDEFINES Case-1-Condition-ID.
04 Class-Code PIC S9(4) BINARY.
04 Cause-Code PIC S9(4) BINARY.
03 Case-Sev-Ctl PIC X.
03 Facility-ID PIC XXX.
02 I-S-Info PIC S9(9) BINARY.
PROCEDURE DIVISION.
PARA-3LNGQRY.
*************************************************
** Specify 2 for QUERY function.
** Call CEE3LNG to query the current
** national language setting
*************************************************
MOVE 2 TO FUNCTN.
CALL "CEE3LNG" USING FUNCTN, LANG, FC.
IF CEE000 of FC THEN
DISPLAY "Current National Language is: "
LANG
ELSE
DISPLAY "CEE3LNG(query) failed with msg "
Msg-No of FC UPON CONSOLE
STOP RUN
END-IF.
PARA-3LNGSET.
*************************************************
** If the current national language is not
** mixed-case U.S. English, then call
** CEE3LNG with the SET function (1) to
** change the national language to mixed-case
** U.S. English
*************************************************
IF ( LANG IS NOT = "ENU" ) THEN
MOVE 1 TO FUNCTN
CALL "CEE3LNG" USING FUNCTN, LANG, FC
IF NOT CEE000 of FC THEN
DISPLAY "CEE3LNG(set) failed with msg "
Msg-No of FC UPON CONSOLE
STOP RUN
END-IF
DISPLAY "The national language has ",
"been changed to mixed-case "
"U.S. English (ENU)."
END-IF.
GOBACK.
- Following is an example of CEE3LNG called by PL/I.
*PROCESS MACRO;
/* Module/File Name: IBM3LNG */
/****************************************************/
/** */
/** Function: CEE3LNG - set national language */
/** */
/** In this example, CEE3LNG is called to query the */
/** current national language setting. If the */
/** setting is not mixed case American English, */
/** CEE3LNMG is called to change the setting to that*/
/** */
/****************************************************/
PLI3LNG: PROC OPTIONS(MAIN);
%INCLUDE CEEIBMAW;
%INCLUDE CEEIBMCT;
DCL FUNCTN REAL FIXED BINARY(31,0);
DCL LANG CHARACTER ( 3 );
DCL 01 FC, /* Feedback token */
03 MsgSev REAL FIXED BINARY(15,0),
03 MsgNo REAL FIXED BINARY(15,0),
03 Flags,
05 Case BIT(2),
05 Severity BIT(3),
05 Control BIT(3),
03 FacID CHAR(3), /* Facility ID */
03 ISI /* Instance-Specific Information */
REAL FIXED BINARY(31,0);
FUNCTN = 2; /* Specify code to query current */
/* national language */
/* Call CEE3LNG with function code 2 to query */
/* national language */
CALL CEE3LNG ( FUNCTN, LANG, FC );
IF FBCHECK( FC, CEE000) THEN DO;
PUT SKIP LIST('The current national language '
|| 'is ' || LANG );
END;
ELSE DO;
DISPLAY('CEE3LNG failed with msg ' || FC.MsgNo);
STOP;
END;
/* If the current language is not mixed-case */
/* American English, set it to mixed-case */
/* American English */
IF LANG ¬= 'ENU' THEN DO;
FUNCTN = 1;
CALL CEE3LNG ( FUNCTN, 'ENU', FC);
IF ¬ FBCHECK( FC, CEE000) THEN DO;
DISPLAY( 'CEE3LNG failed with msg '
|| FC.MsgNo );
STOP;
END; CALL CEE3LNG ( 2, LANG, FC);
IF FBCHECK( FC, CEE000) THEN DO;
PUT SKIP LIST('The national language is now '
|| LANG );
END;
ELSE DO;
DISPLAY( 'CEE3LNG failed with msg '
|| FC.MsgNo );
STOP;
END;
END /* Language is not ENU */;
END PLI3LNG;
- Table 1 lists the supported national
language codes.
Table 1. National language codesID |
National Language |
---|
AFR |
Afrikaans |
ARA |
Arab countries |
BGR |
Bulgarian |
CAT |
Catalan |
CHT |
Traditional Chinese |
CHS |
Simplified Chinese |
CSY |
Czech |
DAN |
Danish |
DEU |
German |
DES |
Swiss German |
ELL |
Greek |
ENG |
U.K. English |
ENU |
U.S. English |
ESP |
Spanish |
FIN |
Finnish |
FRA |
French |
FRB |
Belgian French |
FRC |
Canadian French |
FRS |
Swiss French |
HEB |
Hebrew |
HUN |
Hungarian |
ISL |
Icelandic |
ITA |
Italian |
ITS |
Swiss Italian |
JPN |
Japanese |
KOR |
Korean |
NLD |
Dutch |
NLB |
Belgian Dutch |
NOR |
Norwegian - Bokmal |
NON |
Norwegian - Nynorsk |
PLK |
Polish |
PTG |
Portuguese |
PTB |
Brazilian Portuguese |
RMS |
Rhaeto-Romanic |
ROM |
Romanian |
RUS |
Russian |
SHC |
Serbo-Croatian (Cyrillic) |
SHL |
Serbo-Croatian (Latin) |
SKY |
Slovakian |
SQI |
Albanian |
SVE |
Swedish |
THA |
Thai |
TRK |
Turkish |
UEN |
U.S. uppercase English |
URD |
Urdu |
|