IBM Support

Unicode conversion of the string literals in DataStage parallel transformer

Question & Answer


Question

How does a string literal defined (hard coded string literal) in a transformer column derivation get converted to unicode format?

Answer

The code page used for string literals depends on the content of the literal string.

When a MULTI BYTE string literal is defined (string literal hard coded) as a column value in a parallel transformer and its schema is defined as unicode character type then the string literal gets converted to unicode using "UTF-8" code page.

When a SINGLE BYTE string literal is defined (string literal hard coded) as a column value in a parallel transformer and its schema is defined as unicode character type then the string literal gets converted to unicode using the job level NLS code page.

If you would like to specify a code page for converting the string literal in to unicode format, you can use the transform function StringToUString("string literal", "NLS code page name") in the column definition. This function will always use the given NLS code page (which is passed as argument to StringToUString() function) for converting the string literal to unicode string regardless of the value of the string literal.

Examples:
If the string literal is Japanese literal string, say "ああ", it gets converted to unicode string using "UTF-8" code page.
If the string literal is ascii literal string "abc", and the job level NLS code page is set to "ASCL_MS1252", then "abc" gets converted to unicode string using "ASCL_MS1252" code page.
If the string literal is "ああ22" and you would like to convert it to unicode string using a code page, say ASCL_EBCDIC, then you can use the transform function StringToUString("ああ22", "ASCL_EBCDIC").

[{"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":"9.1;8.7;8.5;8.1;11.3","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21694180