Page 1 of 2

Trim in Modify stage

Posted: Mon Jun 25, 2007 4:48 am
by karthegx
HI ,

Can any one tell me abt the syntax to use in Modify stage for Trim function.

Thanks in Advance

Posted: Mon Jun 25, 2007 5:29 am
by JoshGeorge
That wil be string_trim()

You have posted in the wrong forum.

Posted: Mon Jun 25, 2007 5:59 am
by karthegx
This syntax is enough for removing all leading and trailing spaces.

Posted: Mon Jun 25, 2007 7:18 am
by ray.wurlod
Is your copy of Parallel Job Developer's Guide broken?
:roll:

Posted: Mon Jun 25, 2007 11:07 pm
by JoshGeorge
Not sure if this is in Parallel Job Developer's Guide. This is the syntax :

Code: Select all

string_trim[character,direction,justify](string) 
This function can be used to trim occurrences of a character from the beginning or end of a string.
Ex:

Code: Select all

string_trim[" "](string)   --> Will trim all trailing spaces
string_trim[" ",begin](string)   --> Will trim all leading spaces
But you cannot trim both leading and trailing spaces using this function.

Posted: Tue Jun 26, 2007 2:09 am
by ray.wurlod
Good catch. However it IS in the Orchestrate Operators guide. Page 13-19 in the version 7.5 manual. Curiously, string_trim does not appear in the version 7.0 Orchestrate Operators guide.

Posted: Tue Jun 26, 2007 4:36 am
by karthegx
Can any one send me Orchestrate Operators guide 7.5 version

Thanks George

Posted: Tue Jun 26, 2007 4:56 am
by ray.wurlod
You support provider can supply the Orchestrate manuals at no charge for the asking.

Posted: Wed Feb 06, 2008 4:29 pm
by manishk
Seems the Trim functions doesnt work in the modify Stage. i tried the option in Orchestrate manual and also tried the one given here , but it is not triming the spaces.

I used string_trim() and also tried with strip_whitespace () and trim_leading_trailing command. it doesnt work

Please let me know if there is anything different.

Manish

Posted: Wed Feb 06, 2008 7:50 pm
by ray.wurlod
Please provide the exact syntax you used for string_trim(). It works OK for me on version 7.5.1A on Linux.

Posted: Thu Feb 07, 2008 9:37 am
by manishk
Here is my data in column n1 :

"Hello World"
and " Hello "

Here is my syntax :

1 . n3 : string = string_trim (n1)
2. n3 : string = strip_whitespace(n1)
3. n3 : string = trim_leading_trailing(n1)

This is not stripping the white spaces.

Data stage is running on AIX 3 5

Thanks
manish

Posted: Thu Feb 07, 2008 2:17 pm
by ray.wurlod
I wonder if it's because of the unbounded string specification of the data type. Try

Code: Select all

n3:string[max=20] = string_trim[" ",end,begin](n1)

Posted: Thu Feb 07, 2008 6:19 pm
by vmcburney
I copied a bunch of Modify Stage code from the DataStage and Orchestrate guides into this wiki. Sh, don't tell IBM. The string_trim is in there. Was thinking it would be a good place to add sample code but never got around to it. Feel free to modify it.

Posted: Thu Feb 07, 2008 8:55 pm
by ray.wurlod
There's as complete a list of Modify stage functions as I've been able to construct here

Posted: Fri Apr 18, 2008 8:26 am
by Meera
Thanks Ray. The List of Modify stage functions pdf which you send is very helpful. I was looking at the 7.0 orchestrate manual for the string_trim and couldnt find it and then browsed the forum. This list helps.