px version of Ereplace()

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

:|
I think i really need to take out the 2B outta my name.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DSguruji ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

ray.wurlod wrote:DSguruji ?
Now thats more like it. Hehe
Either your a huge Indian movie fan Ray or you've spend a lot of time in India :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

ray.wurlod wrote:DSguruji ?
To be honest, a well deserved :wink: tag.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There aren't all that many places that Ray hasn't spent some time in, it seems, and some would definitely qualify as 'a lot'. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DSguru2B wrote::| I think i really need to take out the 2B outta my name.
DSGuru2B or DSGuru!2B, that is the question.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

chulett wrote: DSGuru2B or DSGuru!2B, that is the question.
Time shall tell :wink:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

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
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

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.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Mamu Kim
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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 ?!!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Someone needs to organize all this into a real FAQ.
Mamu Kim
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply