Page 1 of 1

Modify Stage

Posted: Thu Oct 12, 2006 1:30 am
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

Re: Modify Stage

Posted: Thu Oct 12, 2006 3:49 am
by khaja.arshad
Still waiting for reply

Can any one come uo with Answer



Thanks

Posted: Thu Oct 12, 2006 3:50 am
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.

Posted: Thu Oct 12, 2006 4:01 am
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

Posted: Thu Oct 12, 2006 4:22 am
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.

Posted: Thu Oct 12, 2006 6:04 am
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?

Posted: Thu Oct 12, 2006 10:34 am
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??

Posted: Thu Oct 12, 2006 8:41 pm
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.