Page 1 of 1

Can I perform two actions within a transformer derivation?

Posted: Wed Oct 03, 2001 8:59 pm
by admin
All,
I have a question about what actions are possible within a derivation. I am checking that an input value is within a range. If it is not within the range, I would like to perform two actions-- 1) modify the output for that field so that the error is easily identifiable in the error log, and 2) set a stage variable flag to note that an invalid value has been found (so that another output link of the transformer knows to reject that record). I have not found a way to perform two actions within an If statement in a derivation, though. Is it possible to do that? Perhaps I am overlooking another construct for accomplishing the same task?
I am running DS 4.0 on AIX.
Thank you,
Mark

Posted: Wed Oct 03, 2001 9:40 pm
by admin
Sounds to me like you want to perform the test in a stage variable. Set the stage variable to a "1" if it is in the range or "0" if it is not. This stage variable is used in the if statement for the derivation where you need to modify the output field value. It is also used as the constraint for your other link.

Hope this helps.
mark.huffman@baesystems.com wrote: All,
I have a question about what actions are possible within a derivation. I am checking that an input value is within a range. If it is not within the range, I would like to perform two actions-- 1) modify the output for that field so that the error is easily identifiable in the error log, and 2) set a stage variable flag to note that an invalid value has been found (so that another output link of the transformer knows to reject that record). I have not found a way to perform two actions within an If statement in a derivation, though. Is it possible to do that? Perhaps I am overlooking another construct for accomplishing the same task? I am running DS 4.0 on AIX. Thank you, Mark



---------------------------------
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. Yahoo! by Phone.

Posted: Wed Oct 03, 2001 10:30 pm
by admin
Tony,
Thanks. That works.
Mark

-----Original Message-----
From: Tony Curcio [mailto:tonycurcio@yahoo.com]
Sent: Wednesday, October 03, 2001 4:40 PM
To: datastage-users@oliver.com
Subject: Re: Can I perform two actions within a transformer derivation?



Sounds to me like you want to perform the test in a stage variable. Set the stage variable to a "1" if it is in the range or "0" if it is not. This stage variable is used in the if statement for the derivation where you need to modify the output field value. It is also used as the constraint for your other link.

Hope this helps.
mark.huffman@baesystems.com wrote: All,
I have a question about what actions are possible within a derivation. I am checking that an input value is within a range. If it is not within the range, I would like to perform two actions-- 1) modify the output for that field so that the error is easily identifiable in the error log, and 2) set a stage variable flag to note that an invalid value has been found (so that another output link of the transformer knows to reject that record). I have not found a way to perform two actions within an If statement in a derivation, though. Is it possible to do that? Perhaps I am overlooking another construct for accomplishing the same task? I am running DS 4.0 on AIX. Thank you, Mark



---------------------------------
Do You Yahoo!?
NEW from Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month. Yahoo! by Phone.