IBM Support

IBM InfoSphere DataStage: NLS_LANG settings for Oracle

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:

  1. In DS Administrator, select the project and click on Properties
  2. In Project Properties -> General tab, click on Environment...
  3. Under Categories, click on User Defined
  4. In Details, add the following:
    Name = NLS_LANG
    Type = String
    Prompt = <whatever you choose>
    Value = <leave blank for now>
  5. Open the job in DS Designer
  6. Go to Job Properties (Edit -> Job Properties or click on the Job Properties icon)
  7. Parameters tab, click on Add Environment Variable...
  8. Under User Defined, scroll down to choose NLS_LANG
  9. 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:
  1. 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.
  2. 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.

[{"Product":{"code":"SSVSEF","label":"IBM InfoSphere DataStage"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"--","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"8.5;8.1;8.0.1;7.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21439982