Created On: 25 March 2011
Problem:
A customer received the following error when running a COBOL program: â40 National Language Initialization not set up correctlyâ. They had set environment variable "LANG=zh_TW.big5" ("big5" represents the Chinese double-byte character set). When they changed the environment variable to "LANG=en_US" the program ran normally.
Does Studio Enterprise Edition/Server Express support zh_TW.big5 (or whichever one you require) and how do you find out what is supported?
Does Studio Enterprise Edition/Server Express support zh_TW.big5 (or whichever one you require) and how do you find out what is supported?
Resolution:
The short answer is Server Express/Studio EE does not support LANG=zh_TW.big5. In fact Server Express/Studio EE does not support any Chinese character set.
If you have a look in the $COBDIR/lang directory you will see what character sets are supported by Micro Focus. And in this instance there will not be a directory for zh_TW.
But, thatâs not the cause of this error, and itâs important to understand exactly what the LANG environment variable is looking for.
So what do you need installed for the LANG setting to work?
The LANG environment variable looks for the âlocaleâ.
To find out which localesâ are installed on your operating system you need to type the command:
locale âa
Or, if you want to look for a specific locale, such as zh_TW.big5 in this instance, youâd type:
locale -a | grep zh_TW
If zh_TW.big5 is not listed then it means that it is not supported at an operating system level. For LANG to work the locale specified must be installed.
The COBOL RTS will try and use the specified locale, and if it cannot be resolved it will report the error â40 National Language Initialization not set up correctlyâ. So this error is caused by the character set not being supported at an operating system level and is not the result of that character set not being available in $COBDIR/lang.
So whatâs the relationship between $LANG and the $COBDIR/lang directory?
The locale specified in LANG must exist at the OS level. Then, if there is an equivalent in $COBDIR/lang, that is used by Micro Focus for such things as rts messages, compiler messages etc.
The locale is set via the LANG, LC_ALL or other LC_ prefix environment variables. You can see the full list when you type: locale . For more details type: man 7 locale.
The locale defines, among other things:
⢠Which byte values, or sequences of bytes, are valid characters. For example, the DBSPACE (double byte space) value is different for ShiftJis, EUC and Big5.
⢠The collating sequence - ie. how to sort characters and strings. For example, NLS accented characters are sorted the same as the equivalent ASCII, non-accented, character values.
⢠The language of messages.
The $COBDIR/lang directory contains the MF message files. We supply English and Japanese message files, but if you use a non-English, non-Japanese locale then the default language for messages is English.
So in summary:
The specified locale in the LANG environment variable must exist on the OS, and if it does not error 40 will be returned. But the equivalent does not have to exist in $COBDIR/lang.
If you have a look in the $COBDIR/lang directory you will see what character sets are supported by Micro Focus. And in this instance there will not be a directory for zh_TW.
But, thatâs not the cause of this error, and itâs important to understand exactly what the LANG environment variable is looking for.
So what do you need installed for the LANG setting to work?
The LANG environment variable looks for the âlocaleâ.
To find out which localesâ are installed on your operating system you need to type the command:
locale âa
Or, if you want to look for a specific locale, such as zh_TW.big5 in this instance, youâd type:
locale -a | grep zh_TW
If zh_TW.big5 is not listed then it means that it is not supported at an operating system level. For LANG to work the locale specified must be installed.
The COBOL RTS will try and use the specified locale, and if it cannot be resolved it will report the error â40 National Language Initialization not set up correctlyâ. So this error is caused by the character set not being supported at an operating system level and is not the result of that character set not being available in $COBDIR/lang.
So whatâs the relationship between $LANG and the $COBDIR/lang directory?
The locale specified in LANG must exist at the OS level. Then, if there is an equivalent in $COBDIR/lang, that is used by Micro Focus for such things as rts messages, compiler messages etc.
The locale is set via the LANG, LC_ALL or other LC_ prefix environment variables. You can see the full list when you type: locale . For more details type: man 7 locale.
The locale defines, among other things:
⢠Which byte values, or sequences of bytes, are valid characters. For example, the DBSPACE (double byte space) value is different for ShiftJis, EUC and Big5.
⢠The collating sequence - ie. how to sort characters and strings. For example, NLS accented characters are sorted the same as the equivalent ASCII, non-accented, character values.
⢠The language of messages.
The $COBDIR/lang directory contains the MF message files. We supply English and Japanese message files, but if you use a non-English, non-Japanese locale then the default language for messages is English.
So in summary:
The specified locale in the LANG environment variable must exist on the OS, and if it does not error 40 will be returned. But the equivalent does not have to exist in $COBDIR/lang.
Incident #2508011
Old KB# 33755
#StudioEnterpriseEdition
#Enterprise
#COBOL
#ServerExpress
#EnterpriseServer
#Server