Dynamically modifying external function's logic

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

Post Reply
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Dynamically modifying external function's logic

Post by visvacfirvin »

Hi,
Is it possible to dynamically modify the logic of external CPP routine.

So for example i've routine to calculate value for column A.

Now there are clients for which the logic changes dynamically say

Client X - Logic 1
Client Y - Logic 2
Client Z - Logic 3

The logic will be different but the column for which the computation to be done will be same(say A). Is there a way to dynamically modify the contects of routine at runtime. Since we include either the object or lib file for routines, is there a way to compile the CPP at runtime but the contents of the routine will be different(routine name being same) according to the client.

Sound wierd though... :wink:

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

Post by ray.wurlod »

It's not possible. You could certainly change the source code dynamically, even compile and link that, but the job would already have connected to (opened) the older version.

Preferable would be to build the flexibility into the function code itself.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly... just pass in the Client or perhaps "Logic" number as an argument at runtime and have them all coded in. That's as dynamic as you're gonna get.
-craig

"You can never have too many knives" -- Logan Nine Fingers
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Post by visvacfirvin »

Was waiting for my premium membership.

We cannot embed the logic into the code because, the code changes very dynamically. We have about 100s of clients and the logic will be changed by users and our system will run with that logic. Currenly its done in Perl. We do use DS PX for other functionalities. Was thinking whether we can move from Perl to completely DS.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Why not leverage the Perl code from DataStage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Post by visvacfirvin »

That did not strike me.. :)

Are you suggesting build ops for this logic?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Hmmm... External Source stage? Perhaps a build op but there should be a stage that will let you leverage 'external' processes on a row-by-row basis, I do believe.
-craig

"You can never have too many knives" -- Logan Nine Fingers
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Post by visvacfirvin »

Using external source stage to call perl programs? That wont be a nice option for us, as this would same as executing the Perl program we have now... :)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What's so not nice about that? You've already got Perl expertise and people know how to maintain it, I assume. Would you really rather rewrite the whole damn thing in C++? :? (which of course you could do)
-craig

"You can never have too many knives" -- Logan Nine Fingers
visvacfirvin
Premium Member
Premium Member
Posts: 49
Joined: Fri Dec 14, 2007 1:43 pm

Post by visvacfirvin »

Hahaha... :D
Thats not the case with us. I'll not rewrite the code and all. Users will have the ability to write logic and that logic will be executed. That will be small business logic they write in perl syntax. This will be embedded in Perl and executed.

Now moving to Datastage,i know they might have to rewrite them in cpp. I'm jus trying out options to move from Perl to DS.
Post Reply