Multiple of contraints condition in Transformer

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
Perwezakh
Premium Member
Premium Member
Posts: 38
Joined: Mon Jun 06, 2005 9:13 am
Location: Chicago, IL

Multiple of contraints condition in Transformer

Post by Perwezakh »

Hi guys,
I have a condition and trying hard to make it work. Need hint.
I have two columns Col1 and Col2. And these two columns I have required flags (these flag will tell me for which client these two data columns are required or not). Now in tranformer constraint I have to reject the record, IF Require_Flag for Col1 = "Y" and DataType of Col1 is Good Then Pass the data to good link Else Reject the record. AND Same logic for Col2.
I am unable to put multiple of IF conditions into contraints.
Help will be appreciated
Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You don't need "IF" statements in a constraint, just expressions that evaluate to true or false. So, ignoring the part where we don't know what "is good" means, at a high level you would use this in the constraint:

Code: Select all

(Require_Flag for Col1 = "Y" and DataType of Col1 is Good) or (Require_Flag for Col2 = "Y" and DataType of Col2 is Good)
Something like that (perhaps with 'or' not 'and') would be the constraint on the keep link and you can either mark the reject link as a Reject or simply Not() the entire previous expression.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply