Page 1 of 1

how to get substring from string

Posted: Mon Aug 06, 2007 5:32 am
by ketanshah123
hi
how to get the substring from string in DS PX?
there is substrings function in server jobs,is there any such function in parallel job?

Posted: Mon Aug 06, 2007 6:17 am
by JoshGeorge
InputString[StartPosition,NumberOfChar]

Posted: Mon Aug 06, 2007 6:17 am
by Maveric
Yes. FieldName[3,5]. ie from 3rd field take 5 characters. for an input "Anexample" will return "examp"

Posted: Mon Aug 06, 2007 6:22 am
by chulett
In other words, the exact same function. :wink:

Posted: Mon Aug 06, 2007 6:44 am
by bkumar103
There is no direct function available in the parallel jobs. You have to make use of Right and left function. Like for example for the string "Hello" if we want to get the substring "ell" then left(right("Hello",4),3) and like this.

Posted: Mon Aug 06, 2007 2:28 pm
by ray.wurlod
Despite bkumar103's confident assertion there IS a direct operation available in parallel jobs. In the Transformer stage use the square bracket notation mentioned by earlier posters. In the Modify stage use the substring() function, noting that character position is a zero-based number - that is, the first character in the string is position 0.