Trim Function in Modify Stage

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

ajith wrote:
I tried that too,

It is trimming only the trailing spaces not the leading ones.

I seriously don't know what to do now, I have to do Trimming on 3 source feeds. I hate modify stage, it allows me to do nothing. Dont tell me the only way forward is adding 3 transformer stages.
I tried to trim both leading and trailing spaces in a single specification of modify stage before but it did not work.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have you tried two functions?

Code: Select all

string_trim[" ",begin](string_trim[" ",end](MyString))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

ray.wurlod wrote:Have you tried two functions?

Code: Select all

string_trim[" ",begin](string_trim[" ",end](MyString))
Thanks Ray.

I tried the above code and got the following error:
main_program: Error parsing modify adapter: Error in binding: Error in source field selector: Expected integer, got: "" ""
Expected destination field selector, got: ")"; input:
Col2=string_trim[" ",begin](string_trim[" ",end](Col1))
;
ajith
Participant
Posts: 86
Joined: Thu Nov 10, 2005 11:10 pm

Post by ajith »

ray.wurlod wrote:Have you tried two functions?

Code: Select all

string_trim[" ",begin](string_trim[" ",end](MyString))
...

It does not allow me to combine two commands.

I get the same error as Balaji gets
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The modify stage doesn't allow combining commands :(
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Sometimes it does - I've successfully combined string_trim and substring for example.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nageshsunkoji
Participant
Posts: 222
Joined: Tue Aug 30, 2005 2:07 am
Location: pune
Contact:

Post by Nageshsunkoji »

Hi All,

Final Conclusion from this disscussions is , it is not possible to trim leading and trailing spaces by using Modify stage. It is possible only through Transformer stage. So, can I ask DS gurus, can we ask this functionality in the next release of datastage to IBM. If the above conclusion is right. I am asking to all, If anybody got the answer of TrimLeading and Trailing by using modify stage, please let us know, other wise, we will raise this with IBM.
NageshSunkoji

If you know anything SHARE it.............
If you Don't know anything LEARN it...............
Post Reply