px version of Ereplace()
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What would really make a good FAQ would be step by step instructions for creating a parallel routine to invoke this function. Begin with the steps for getting it compiled, linked and tested external to DataStage (a small main() program, of course). You might even discuss the relative merits of creating a shared object or a function in a shared library. Finally, of course, the step of creating the "parallel routine" (interlude) in DataStage, again step by step with explanations. For completeness, using the parallel routine in a Transformer stage, and troubleshooting it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Ray is correct. You need to compile your C program. You need to compile it using the same options as DataStage. You can lookup the compiler and options used in the Administrator. I would have to do a search to remember how we did this. When you compile on AIX your file has to end in .C and not .c. This tells your compiler that it is a C++ program. Next name your .o file to be pxReplace.o. You need to add your routine in DataStage and point it to this file. So maybe you put it in /usr/local/bin/pxReplace.o. You need to tell it how many arguments this routine needs. Next you can start using it.
Mamu Kim
I will try to post more details tomorrow. Another tip is your program can have a main() like Ray says. Your routine needs a function to call other than main() but you can have a main() which in this case calls Ereplace(). If you have a main() then you can test it from the UNIX command line. I posted 2 ways of doing this with crc32(). Do a search. One works with command line arguments. The other works by piping data into the command.
You have to compile the routine differently to make it work standalone. The routines need to linked into whatever object code your PX job creates in order for DataStage to use it. A standalone command has to be linked into standard libraries in order to make it work. This was covered in the crc32() routine topic.
You have to compile the routine differently to make it work standalone. The routines need to linked into whatever object code your PX job creates in order for DataStage to use it. A standalone command has to be linked into standard libraries in order to make it work. This was covered in the crc32() routine topic.
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
What I really meant was to create a separate "test bed" containing main(), a bit like the server routines test environment but in C and at the O/S level.
DSguruji, where's the FAQ ?!!
DSguruji, where's the FAQ ?!!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sorry for the delayed response guys, just been burning midnight oil at my end.
As for the FAQ, will definately come up with something, soon.
A main function is nothing but somthing to test out your function. C has been around for ages and hence you can find a lot of info on the web, untill I, or Kim, compose a proper FAQ. Plus I am not at a PX site so will have to see if I can get my hands on a compiler.
As for the FAQ, will definately come up with something, soon.
A main function is nothing but somthing to test out your function. C has been around for ages and hence you can find a lot of info on the web, untill I, or Kim, compose a proper FAQ. Plus I am not at a PX site so will have to see if I can get my hands on a compiler.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.