Three steps to enable your NLS support on IBM i

本文介绍如何在IBM系统中快速启用中文语言支持,包括更改系统值、安装次要语言及添加NLS库,确保中文字符能正确输入与显示。

As we know, globalization makes the world fatter and smarter. A big portion of IBM i customers are from the growth market, like China and Japan. National Language Support (NLS) on IBM i is an important topic.

 

However, the users are not happy always with their NLS support. Let’s take a look at what will happen if they do not install their local NLS package. For example, if I install an IBM i system, say V6R1, without Chinese language package, and I am trying to input and output something using terminal 5250 session.

 

First, let me try to input a Chinese character, what will happen? What a pity, I can not input at all, instead, I am told ‘You are trying to input unavailable graphic character…’.

 

Figure 1 Error occurs while trying to input Chinese character

 

Next, let me try to output a text file test.txt which I wrote it on windows, as follow:

Chinese: 我的名字叫皮光明

English: My name is Pi Guang Ming

 

Then try to display it with the CCSID value 37. As you can see, the Chinese Charater我的名字叫皮光明 can not appear.  

Figure 2 Chinese character shows not correctly

 

In this article, I’ll share three steps to quickly enable NLS support on your IBM i. I will take Chinese as an example.

 

1.        Step 1. Chang your system value

l           Change system value QCHRID(Graphic character set and code page identifier) as 1174/836.

CHGSYSVAL SYSVAL(QCHRID) VALUE('1174 836')

Graphic character set: Specify the graphic character set values that match the attributes of the display device. Valid values range from 1 through 32767.

Code page: Specify the code page set values that match the attributes of the display device. Valid values range from 1 through 32767.

l           Change system value QCNTRYID(Country identifier) as ‘CN’.

CHGSYSVAL SYSVAL(QCNTRYID) VALUE(' CN ')

QCNTRYID: Specify the default country or region identifier for the system.

l           Change system value QCCSID(Coded character set identifier) as 935

CHGSYSVAL SYSVAL(QCCSID) VALUE(935)

QCCSID: Specify the CCSID for the overall IBM i system.

l           Change system value QLANGID(Language identifier) as ‘CHS’

CHGSYSVAL SYSVAL(QCCSID) VALUE(935)

QLANGID: Specify the default language identifier for the system.

Note: You can use the IBM i system value finder to quickly locate the information about system values. See IBM i and System i Information Center for more details.

 

2.        Step 2. Install 2989(Chinese) as the secondary language

Follow the following instructions given by Installing secondary languages for IBM licensed programs to install 2989(Chinese) as the second language.

 

3.        Step 3. Add NLS library into the system library list for the current thread.

CHGSYSLIBL LIB(QSYS2989) OPTION(*ADD)

 

Now, you’ve successfully enable NLS support for Chinese, change the 'Code Page' value to 1388 on the 5250 session and then sign on, you will see:

 

Figure 3 Chinese character shows properly

 

If you want to switch screen back to English, just remove NLS library from the system library list for the current thread.

CHGSYSLIBL LIB(QSYS2989) OPTION(*REMOVE)

"failed to get local nls_lang"是一个错误信息,通常在使用数据库或运行某些程序时出现。这个错误信息通常表示系统无法获取本地的"NLS_LANG"(National Language Support)设置。 "NLS_LANG"是一个环境变量,用于指定数据库和程序的字符集。它决定了如何在系统中处理不同语言和字符编码。当系统无法获取本地"NLS_LANG"设置时,会出现"failed to get local nls_lang"错误。 解决此错误的方法是按照以下步骤操作: 1. 检查系统环境变量设置:确保"NLS_LANG"环境变量已正确设置。您可以在操作系统的环境变量设置中查看或编辑此设置。确保"NLS_LANG"的值与您需要的字符集匹配。 2. 检查数据库配置:如果您在使用数据库时遇到此错误,请确保数据库配置文件中的"NLS_LANG"参数正确设置。您可能需要联系数据库管理员或查看数据库相关文档来进行正确配置。 3. 检查程序设置:如果此错误是在运行某个程序时出现的,请检查程序的配置文件或代码中是否有"NLS_LANG"设置。将其设置为正确的值。 4. 重新启动系统:在进行上述更改后,重新启动系统以确保环境变量和配置生效。 需要注意的是,对于不同的操作系统和应用程序,解决此错误的具体步骤可能会有所不同。您可以参考相关的操作系统和应用程序文档来获取更详细的解决方案。 总之,"failed to get local nls_lang"错误表示系统无法获取本地的"NLS_LANG"设置,通过正确设置环境变量和配置,可以解决此问题。
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值