>>-SETLANG(-+----------+-)-------------------------------------><
'-langcode-'
SETLANG
returns a three character code that indicates the language in which
REXX messages are currently being displayed. Table 1 shows the language codes that replace
the function call and the corresponding languages for each code.
You
can optionally specify one of the language codes as an argument on
the function to set the language in which REXX messages are displayed.
In this case, SETLANG returns the code of the language in which messages
are currently displayed and changes the language in which subsequent
REXX messages will be displayed.
Table 1. Language codes for SETLANG function that replace the function
callLanguage code |
Language |
---|
CHS |
Simplified Chinese |
CHT |
Traditional Chinese |
DAN |
Danish |
DEU |
German |
ENP |
US English - all uppercase |
ENU |
US English - mixed case (upper and lowercase) |
ESP |
Spanish |
FRA |
French |
JPN |
Japanese |
KOR |
Korean |
PTB |
Brazilian Portuguese |
Here are some examples::
curlang = SETLANG() -> 'ENU' /* returns current language (ENU) */
oldlang = SETLANG("ENP")-> 'ENU' /* returns current language (ENU)
and sets language to US English
uppercase (ENP) */
You
can use the SETLANG function in an exec that runs in any MVS™ address space (TSO/E and non-TSO/E).
After
an exec uses SETLANG to set a specific language, any REXX message
the system issues is displayed in that language. If the exec calls
another exec (either as a function or subroutine or using the TSO/E
EXEC command), any REXX messages are displayed in the language you
specified on the SETLANG function. The language specified on SETLANG
is used as the language for displaying REXX messages until another
SETLANG function is invoked or the environment in which the exec is
running terminates.
Note: - The default language for REXX messages depends on the language
feature that is installed on your system. The default language is
in the language field of the parameters module (see Characteristics of a Language Processor Environment). You can use the SETLANG function to
determine and set the language for REXX messages.
- The language codes you can specify on the SETLANG function also
depend on the language features that are installed on your system.
If you specify a language code on the SETLANG function and the corresponding
language feature is not installed on your system, SETLANG does not
issue an error message. However, if the system needs to display a
REXX message and cannot locate the message for the particular language
you specified, the system issues an error message. The system then
tries to display the REXX message in US English.
- Your installation can customize TSO/E to display certain information
at the terminal in different languages. Your installation can define
a primary and secondary language for the display of information.
The language codes for the primary and secondary languages are stored
in the user profile table (UPT). You can use the TSO/E PROFILE command
to change the languages specified in the UPT.
The languages stored
in the UPT do not affect the language in which REXX messages are displayed.
The language for REXX messages is controlled only by the default
in the language field of the parameters module and the SETLANG function.
For
information about customizing TSO/E for different languages and the
types of information that are displayed in different languages, see z/OS TSO/E Customization.
- The SYSVAR external function has the SYSPLANG and SYSSLANG arguments
that return the user's primary and secondary language stored in the
UPT. You can use the SYSVAR function to determine the setting of
the user's primary and secondary language. You can then use the SETLANG
function to set the language in which REXX messages are displayed
to the same language as the primary or secondary language specified
for the user. See SYSVAR for more
information.
Examples:
The following are some
examples of using SETLANG:
- To check the language in which REXX messages are currently being
displayed, use the SETLANG function as follows:
currlng = SETLANG() /* for example, returns ENU */
- The SYSPLANG argument of the SYSVAR function returns the user's
primary language that is stored in the user profile table (UPT).
The
following example uses the SYSVAR function to determine the user's
primary language and then uses the SETLANG function to check the language
in which REXX messages are displayed. If the two languages are the
same, no processing is performed. If the languages are different,
the exec uses the SETLANG function to set the language for REXX messages
to the same language as the user's primary language.
/* REXX ... */
⋮
proflang = SYSVAR('SYSPLANG') /* check primary language in UPT */
rexxlang = SETLANG() /* check language for REXX messages */
IF proflang ¬= rexxlang THEN
newlang = SETLANG(proflang) /* set language for REXX messages */
/* to user's primary language */
ELSE NOP /* otherwise, no processing needed */
⋮
EXIT