Transformer Expression as a Parameter Value
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 37
- Joined: Thu Nov 25, 2004 8:44 pm
- Location: Bangalore, Karnataka, India
Transformer Expression as a Parameter Value
Hi
The expression that goes into a column definition in a Transformer Stage change at every run.
I know the link name and the field names that go into the expression.
I've constructed the expression elsewhere manually/using another tool.
I need to type it as a Job Parameter.
Is there any way of doing this?
The expression that goes into a column definition in a Transformer Stage change at every run.
I know the link name and the field names that go into the expression.
I've constructed the expression elsewhere manually/using another tool.
I need to type it as a Job Parameter.
Is there any way of doing this?
Regards,
Vivek RS
Vivek RS
-
- Participant
- Posts: 37
- Joined: Thu Nov 25, 2004 8:44 pm
- Location: Bangalore, Karnataka, India
Hi vigneshra
But it doesn't seem to work!
I have a transformer that has two input columns a and b coming in from a link lnk. The output has a column result. The derivation for result is a job parameter Exp. Now, if I type lnk.a+lnk.b as the value for Exp, all rows in result gets the literal lnk.a+lnk.b[/code]
But it doesn't seem to work!
I have a transformer that has two input columns a and b coming in from a link lnk. The output has a column result. The derivation for result is a job parameter Exp. Now, if I type lnk.a+lnk.b as the value for Exp, all rows in result gets the literal lnk.a+lnk.b[/code]
Regards,
Vivek RS
Vivek RS
You need CANNOT use job parameters in the way suggested.
Your derivation has to be CODED into the job design. If you have a few expressions, simply use stage variables to derive the result a few difference ways. Then, use a job parameter to act as the switch which decides which derivation to use.
If you have an infinite variation of derivation, then you have to EXTERNALIZE the transformation. DataStage builds compiled programs, you cannot change the logic on the fly. Therefore, using a function that makes an external call side-steps this issue and provides you the functionality you need at a performance cost.
To do what you want to do, and keep performance, make take a little bit of sophistication. You can generate a function on the fly that does your variable derivation. Use it in the job to derive your particular column. Simply create a function that gets all columns potentially required passed as arguments. Then, prior to running your job, programmatically update the function to derive as needed and recompile the function. Since the job uses the function already, it doesn't need to be recompiled. It will take advantage of the new logic.
This is easier that trying to change job logic programmatically, and Transforms, if changed, also require the job to be recompiled. This is probably the easiest thing to do. Your external rules requirement sounds more like you need to be an external rules engine that is more scalable and usable.
Good luck!
Your derivation has to be CODED into the job design. If you have a few expressions, simply use stage variables to derive the result a few difference ways. Then, use a job parameter to act as the switch which decides which derivation to use.
If you have an infinite variation of derivation, then you have to EXTERNALIZE the transformation. DataStage builds compiled programs, you cannot change the logic on the fly. Therefore, using a function that makes an external call side-steps this issue and provides you the functionality you need at a performance cost.
To do what you want to do, and keep performance, make take a little bit of sophistication. You can generate a function on the fly that does your variable derivation. Use it in the job to derive your particular column. Simply create a function that gets all columns potentially required passed as arguments. Then, prior to running your job, programmatically update the function to derive as needed and recompile the function. Since the job uses the function already, it doesn't need to be recompiled. It will take advantage of the new logic.
This is easier that trying to change job logic programmatically, and Transforms, if changed, also require the job to be recompiled. This is probably the easiest thing to do. Your external rules requirement sounds more like you need to be an external rules engine that is more scalable and usable.
Good luck!
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 38
- Joined: Sat Feb 28, 2004 12:11 pm