Troubleshooting
Problem
The following error occurs when accessing Oracle via the Oracle Connector or Enterprise Stage, and the NLS_LANG environment variable is not properly set: The NLS character map is specified, but NLS_LANG is not set; the NLS character map must be set to an ICU codepage which is equivalent to the character set specified by NLS_LANG.
Symptom
Error:
The NLS character map is specified, but NLS_LANG is not set; the NLS
character map must be set to an ICU codepage which is equivalent to
the character set specified by NLS_LANG.
Diagnosing The Problem
This error indicates that the environment variable NLS_LANG is not correctly set. The NLS_LANG setting is derived from the following three settings in the Oracle database:
NLS_LANGUAGE
NLS_TERRITORY
NLS_CHARACTERSET
The three values are combined using the following pattern:
NLS_LANG=<NLS_LANGUAGE>_<NLS_TERRITORY>.<NLS_CHARACTERSET>
To obtain the above values, run either of the following SQL commands:
> select * from v$nls_parameters;
> select * from nls_database_parameters;
Here is an example of some of the output:
NLS_LANGUAGE AMERICAN
NLS_TERRITORY AMERICA
NLS_CHARACTERSET US7ASCII
Combining these sample values using the pattern above results in the following NLS_LANG setting:
NLS_LANG=AMERICAN_AMERICA.US7ASCII
Resolving The Problem
Note: Information Server / DataStage needs to have been installed with NLS enabled.
If the NLS_LANG parameter is not set in the environment, you can first try adding it to the job to see whether that resolves the problem or not, as follows:
- In DS Administrator, select the project and click on Properties
- In Project Properties -> General tab, click on Environment...
- Under Categories, click on User Defined
- In Details, add the following:
Name = NLS_LANG
Type = String
Prompt = <whatever you choose>
Value = <leave blank for now>
- Open the job in DS Designer
- Go to Job Properties (Edit -> Job Properties or click on the Job Properties icon)
- Parameters tab, click on Add Environment Variable...
- Under User Defined, scroll down to choose NLS_LANG
- Compile and Run the job. When the window displays with the list of parameters before you can actually start the job running, enter the value for NLS_LANG, for example:
AMERICAN_AMERICA.US7ASCII
If setting the environment variable in the job resolves the problem and you want to set it in dsenv, perform these steps:
- Set NLS_LANG environment variable in the dsenv, as follows:
NLS_LANG=AMERICAN_AMERICA.US7ASCII; export NLS_LANG
Note: Use the value for NLS_LANG according to your environment.
- Restart DataStage Engine
Note: Before restarting DataStage be sure to execute "netstat -a | grep dsrpc" to verify that there are not any established connections. If there are established connections have the users exit BEFORE stopping DataStage and run "netstat -a | grep dsrpc" to verify that there is only the rpc daemon with a status of LISTENING.
This will ensure the variable is set for all jobs/projects.
Note: Be sure to remove the NLS_LANG environment variable from the project and job properties.
For more information on NLS, please see document "National Language Support Guide" included with the product.
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21439982