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

Post Reply
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Modify Stage

Post by khaja.arshad »

Hello All

Im trying to Trim a Varchar type field in Modify Stage
with the following specification

M_No = string_trim[""](M_No)

here my M_No is Varchar type field

but it is throwing the error msg at Run time


main_program: Error parsing modify adapter: Error in binding: Parsing parameters """" for conversion "string=string_trim[NULL,end,begin](string)": Only one character, or NULL expected, got:
Expected destination field selector, got: ")"; input:
M_No = string_trim[""](M_No)
;

I have tried with the following options

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

M_No= string_trim[" ", begin](M_No)

M_No= string_trim[" ", end](M_No)

M_No varchar(255)=string_trim(M_No)

But no one is working

Can Any one help me
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Re: Modify Stage

Post by khaja.arshad »

Still waiting for reply

Can any one come uo with Answer



Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The following functions are available for the Modify stage.
  • trimc(string)
    trimc(string, ch)
    trimc(string, ch, option)
    trim_trailing(string)
    trim_leading(string)
    strip_whitespace(string)
    compact_whitespace(string)
    trim_leading_trailing(string)
I think that the last of these might be close to what you want.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
khaja.arshad
Participant
Posts: 30
Joined: Mon May 29, 2006 11:19 pm

Post by khaja.arshad »

Hello Ray

I can't see your message completely

can you please share your knowledge by giving an example to remove trailing spaces

Thanks in Advance
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can YOU please contribute less than $1 per week to help to fund this site?

Then you can see the premium posts.
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 »

This works for me.

Code: Select all

Col1=string_trim[" ",end](Col1)
where Col1 is the column to be trimmed.

But i could not trim both leading and trailing spaces.
Has anyone managed to trim both leading and trailing spaces using modify stage?
ukyrvd
Premium Member
Premium Member
Posts: 73
Joined: Thu Feb 10, 2005 10:59 am

Post by ukyrvd »

search on DS Help resulted in the following function

-----
TrimLeadingTrailing
Returns a string with leading and trailing whitespace removed
string (string)
result (string)
-----

I remember using this in XFM .. you can try and see if its available in Modify stage as well??
thank you
- prasad
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

ukyrvd wrote:search on DS Help resulted in the following function

-----
TrimLeadingTrailing
Returns a string with leading and trailing whitespace removed
string (string)
result (string)
-----

I remember using this in XFM .. you can try and see if its available in Modify stage as well??
I know that it is available in Transformer but could not do the same in the modify stage. I will try what Ray has suggested in the previous post.
Post Reply