1

I am trying to remove leading and trailing spaces in datastage. In Transform stage we can use TrimLeadingTrailing(ID) to achieve this. But without using transform stage , i am trying to use Modify stage . Below is the code

id = string_trim[" ",begin,end](id)

In any of the case by using String_Trim function , only leading or trailing spaces are getting removed. I am unable to achieve both the things.

Please help if there is any way.

Sample Input :

"    Abc  Yyyy    "

Sample Output:

"Abc  Yyyy"
avinash
  • 119
  • 1
  • 13

2 Answers2

0

Well look at the function definition this is obvious

string_trim[NULL, begin](name)

will remove all leading ASCII NULL characters from the beginning of name

string_trim['X', end, begin](text)

will remove all trailing X chars from text

Becasue of this "direction" you cannot do both at the same time

Community
  • 1
  • 1
MichaelTiefenbacher
  • 3,805
  • 2
  • 11
  • 17
0

There is also the Modify stage, which has four functions for dealing with trimming white space and other characters. But the Transformer stage has a more intuitive GUI.

Ray Wurlod
  • 831
  • 1
  • 4
  • 3