"dspmq -n" can be used to force the value of STATUS to be displayed in English, regardless of the language of the locale

Technote (FAQ)


Question

Is there a way to always show the STATUS information of the WebSphere MQ command, dspmq, in English, even when the locale is not English?

Your company has several hosts with Queue Managers in different countries and in each host the locale of the "mqm" user has been customized for other several languages, including English. You were asked to create a script to monitor the status of the queue managers (using the MQ command "dspmq") and you want to capture the status information and proceed to perform an action based on the value of the status. However, you notice that the status information has been internationalized. For example:
English: STATUS(Running)
Spanish: STATUS(En ejecución)

You do not want to complicate the script by having "if" or "switch" statements for each language, because it is going to be difficult to test and whenever there is a new language, the script would need to be modified.

Cause

This scenario is run on a test Linux host that has MQ 7.0.1 and the default language is for English.
The MQ file set for the message catalog for Spanish has been installed:
rpm -ivh MQSeriesMsg_es-7.0.1-0.i386.rpm

After login, verify the default language (specified by the environment variable LANG) and locale.
Note that the output of "locale" is rather long, thus, to keep this technote short, only certain lines are shown from the output.

$ echo $LANG
en_US.UTF-8

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
...
LC_MESSAGES="en_US.UTF-8"

Display the MQ status. Notice that the STATUS is shown in English, which is the language used for the locale for this user.

$ dspmq
QMNAME(QM_1) STATUS(Running)
QMNAME(QM_2) STATUS(Ended normally)

Now, let's change the LANG to the Spanish locale:

$ export LANG=es_ES

Verify the language and locale:

$ echo $LANG
LANG=es_ES

$ locale
LANG=es_ES
LC_CTYPE="es_ES"
...
LC_MESSAGES="es_ES"

Issue the MQ "dspmq" command. Notice that the value for STATUS is shown in Spanish.

$ dspmq
QMNAME(QM_1) STATUS(En ejecución)
QMNAME(QM_2) STATUS(Ha finalizado normalmente)

Answer

You can use the new flag "-n" introduced in MQ 7.0.1 which forces the values used in STATUS to be shown in English, regardless of the language for the locale of the user.


Notice that the values are actually shown in upper-case, such as RUNNING and ENDED NORMALLY.
Thus, you can customize your monitoring script to issue "dspmq -n" and to handle the values in English.

$ dspmq -n
QMNAME(QM_1) STATUS(RUNNING)
QMNAME(QM_2) STATUS(ENDED NORMALLY)

Product Alias/Synonym

WebSphere MQ WMQ

Rate this page:

(0 users)Average rating

Document information


More support for:

WebSphere MQ
Data Conversion

Software version:

7.0.1, 7.1, 7.5

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1411562

Modified date:

2013-10-16

Translate my page

Machine Translation

Content navigation