0

In Datastage, I am using XML hierarchial to parse the source XML files. For the Varchar columns, the leading and trailing spaces are getting trimmed and as well as the mutiple spaces are trimmed to single spaces. But I need the source data as it is in the target.

Using Datastage version 11.7.1. Loading the data into Oracle.

ex: Source data- " Hello World " expected ouput :" Hello World " Actual output : "Hello World"

2 Answers2

0

I've been there once, too and I'm sorry that this is not the answer you expected and I might risking a downvote, but it's my honest suggestion on how to deal with it:

  • Educate your surrounding fellow employees that spaces are to be trimmed!

Leading and trailing spaces should already be ignored when entering data. Nowhere does it really make sense to consider them as data. Spaces are data separators: they separate words, numbers, characters, sentences and so on. They are the things between the data, not the data itself. A word is an array of characters. A sentence is an array of words (and marks) separated by spaces. Spaces are in fact no part of the sentence, they're just separators to organize the content.

Trim them.

Justus Kenklies
  • 440
  • 3
  • 10
0

In which stage are the spaces trimmed? If the Oracle Connector is running in target mode, there is a property under /Usage/Session called "Preserve trailing blanks."

General Grievance
  • 4,555
  • 31
  • 31
  • 45