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:
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.
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
Display the MQ status. Notice that the STATUS is shown in English, which is the language used for the locale for this user.
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
Issue the MQ "dspmq" command. Notice that the value for STATUS is shown in Spanish.
QMNAME(QM_1) STATUS(En ejecución)
QMNAME(QM_2) STATUS(Ha finalizado normalmente)
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_2) STATUS(ENDED NORMALLY)
WebSphere MQ WMQ