Page 1 of 1

Using datastage server routines in Parallel Jobs

Posted: Fri Nov 30, 2018 10:33 am
by nitingupta
Hi All,

I do have a server routine which replaces all the new line characters and some special characters which i am using for each of char and varchar fields in existing design. However server routine does not work in parallel jobs also I've not used parallel routines ever but we need to implement the same Using Parallel Job. Is there any way to do the same except using derivation in transformer stage for each column?

Logic used in server routine is like below:

ereplace(convert(char(10):char(13),' '),'|',' ',-1)


Thank you,
Nitin Gupta

Posted: Fri Nov 30, 2018 11:24 am
by chulett
Of course. You really should become intimately familiar with all of the parallel functions you have at your disposal. Documented online here. I personally would prefer that you go through the documentation and try to solve this yourself rather than just providing the code that you would need. Teach a man to fish and all that...

But of course, make sure you come back and ask questions when you have them!

Posted: Fri Nov 30, 2018 11:53 am
by nitingupta
Thanks craig for the pointer, However we need some generic solution like routine as we need to apply it in multiple jobs for n number of columns . I am aware that we can go for a parallel routine in C++ and use object file of that in parallel routine. Still if there is any other pointer that we can use will be more helpful.

Posted: Fri Nov 30, 2018 3:29 pm
by chulett
Well... this is all IMHO and others are encouraged to chime in as well but I wouldn't head to a C++ custom routine solution for something simple like the example you posted. Save that approach for times when the function either needs to be complex or adds functionality that does not exist in what the product currently delivers.

If you need reusable logic you may want to look into Shared Containers for something like that. As with most this it... depends.

Posted: Fri Nov 30, 2018 5:58 pm
by ray.wurlod
Ereplace() is available as a parallel function in version 11.x.

Posted: Fri Nov 30, 2018 6:27 pm
by chulett
Yup. That should have been the first discovery in the documentation. :wink: