Page 1 of 1

Ereplace in parallel

Posted: Fri Nov 23, 2007 6:24 am
by G SHIVARANJANI
Hi,

I have a string with a1,a2,a3.....i just want to apply transforamtion where the string becomes a1YYa2YYa3


Please suggest...

I tried using convert but it replaces 1 for 1

thanks

Posted: Fri Nov 23, 2007 6:41 am
by Maveric
This might help you.

viewtopic.php?t=106358

Posted: Mon Nov 26, 2007 12:22 am
by G SHIVARANJANI
Maveric wrote:This might help you.

viewtopic.php?t=106358

Hello Maveric,

I could see the C code ....real helpfull....But how can i use this in the transformer stage... please guid me..

thanks

Posted: Mon Nov 26, 2007 12:41 am
by Maveric
Follow the steps to create a parallel function in the designer. I have not created a parallel function before :( . If you are sure it is only two instances of "," that you need to replace then then you might as well use a field() function to get the values a1, a2 and a3 and concatenate them with YY.

Posted: Mon Nov 26, 2007 4:40 am
by G SHIVARANJANI
Maveric wrote:Follow the steps to create a parallel function in the designer. I have not created a parallel function before :( . If you are sure it is only two instances of "," that you need to replace then then you might as well use a field() function to get the values a1, a2 and a3 and concatenate them with YY.
Hi Maveric,

"," can occure any number of times in this string.

how is the C code to be used in DS ?

Thanks

Posted: Mon Nov 26, 2007 4:46 am
by G SHIVARANJANI
Maveric wrote:Follow the steps to create a parallel function in the designer. I have not created a parallel function before :( . If you are sure it is only two instances of "," that you need to replace then then you might as well use a field() function to get the values a1, a2 and a3 and concatenate them with YY.
Hi Maveric,

"," can occure any number of times in this string.

how is the C code to be used in DS ?

Thanks

Posted: Mon Nov 26, 2007 4:48 am
by G SHIVARANJANI
Maveric wrote:Follow the steps to create a parallel function in the designer. I have not created a parallel function before :( . If you are sure it is only two instances of "," that you need to replace then then you might as well use a field() function to get the values a1, a2 and a3 and concatenate them with YY.
Hi Maveric,

"," can occure any number of times in this string.

how is the C code to be used in DS ?

Thanks

Posted: Mon Nov 26, 2007 4:56 am
by Maveric
You would have to compile the code from command line. Generate the .o file. Go to the repository, right click on routines and select parallel routines. Then follow the help.

Posted: Mon Nov 26, 2007 2:08 pm
by ray.wurlod
The code not only has to be compiled, it also has to be linked to construct either a shared object or a function in a shared library.

The "parallel routine" that you create in DataStage is merely an interlude that provides instructions about the location of your (external) routine and its arguments.