Can I perform two actions within a transformer derivation?

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Can I perform two actions within a transformer derivation?

Post 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
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post 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.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post 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.
Locked