Table of Contents

Search

  1. Preface
  2. Part 1: Introduction
  3. Part 2: PowerExchange Client for PowerCenter (PWXPC)
  4. Part 3: PowerExchange ODBC
  5. Appendix A: PowerExchange Interfaces for PowerCenter Tips
  6. Appendix B: Datatypes and Code Pages
  7. Appendix C: PowerExchange Interfaces for PowerCenter Troubleshooting

PowerExchange Interfaces for PowerCenter

PowerExchange Interfaces for PowerCenter

Converting Character Data to Strings

Converting Character Data to Strings

For some data sources, data fields that have a character datatype such as CHAR or VARCHAR might contain embedded nulls. PowerCenter expects character fields to contain null-terminated strings. If character fields contain embedded nulls, unpredictable results might occur for bulk data movement and CDC sessions.
Usually, this problems occurs for z/OS sources with character fields that intentionally or unintentionally contain embedded nulls.
To avoid this problem, you can convert character fields to string fields. For string data fields, PowerCenter converts each embedded null to a space.
For example, a single character field is a collection of subfields. The user application that writes data to the
z/OS
source uses null delimiters (x’00’) to separate the subfields.
The character field contains the following hexadecimal EBCDIC data:
C1C2C3
00
C4C5C6C7
00
C8C9
In this data, the double zeroes represent the null delimiters. The user application parses the data into the following hexadecimal strings:
  • x’C1C2C3’ (translates to text "ABC")
  • x’C4C5C6C7’ (translates to text "DEFG")
  • x’C8C9’ (translates to text "HI")
No explicit mapping of the subfields exists. PowerCenter reads only the string "ABC" for the session and truncates the rest of the data, after the first null delimiter.
Besides truncation, other unpredictable results can occur, such as session failure. Problems are less likely to occur if the workflow passes the data directly through to the target without a transformation.
To mitigate these issues, you can convert character data with embedded nulls to strings so that the nulls are handled as spaces. Use one of the following methods:
  • To have PowerCenter convert character fields for all sources that use a connection, select the
    Convert character data to string
    attribute on the connection. By default, this attribute is not selected and PowerCenter passes the nulls in the character fields to the target.
  • To manually convert individual character fields in a table, edit the source definition in Source Analyzer. In the
    Edit Tables
    dialog box, click the
    Columns
    tab. Then, change the datatype for each CHAR and VARCHAR column that you want to convert to STRING. This method is more efficient if you know which character columns are likely to contain nulls.
If you apply one of these conversion methods to the preceding example EBCDIC data, PWXPC replaces the zeroes with "40" when reading the data:
C1C2C3
40
C4C5C6C7
40
C8C9
When PowerCenter extracts this data to the target, it replaces the "40" values with spaces:
ABC DEFG HI

0 COMMENTS

We’d like to hear from you!