Transformer constraint

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
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

Transformer constraint

Post by srinivas Guduru »

Hi

I am using transformer in Parallel Extender job. Transformer with two output links (First and Second), to split the input data.

I want to write a constraint for First(Link name) link.

when values for perticular input column (Role_ID) has AAAAA then I need to populate PPPPP

If column (Role_ID) has BBBBB then I need to populate PPPPP
If column (Role_ID) has CCCCC then I need to populate PPPPP
If column (Role_ID) has DDDDD then I need to populate PPPPP
If column (Role_ID) has EEEEE then I need to populate PPPPP

And I need to direct all these records (Role_ID has AAAAA, BBBBB, CCCCC, DDDDD, EEEEE) to First (Link name) output link.



About Second output link of the transformer

I naeed direct all the records (every record of the input) to the Second output link of the transforme


And I am using the following condition on the First link constraint, but not working

IF Today.PO_ROLE_CD = "OWTR " then Today.PO_ROLE_CD = "PPPPP" else IF Today.PO_ROLE_CD = "TRST " then Today.PO_ROLE_CD = "PPPPP" else
IF Today.PO_ROLE_CD = "CUSN " then Today.PO_ROLE_CD = "PPPPP" else IF Today.PO_ROLE_CD = "BRKR " then Today.PO_ROLE_CD = "PPPPP"

I am looking for the solution

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Constraints are expressions that evaluate to True or False and which control whether the link 'fires' or not, i.e. if data is allowed down it or not. What you've posted are assignments, in other words expressions that belong in the derivation of specific output fields, not in a constraint.
-craig

"You can never have too many knives" -- Logan Nine Fingers
srinivas Guduru
Premium Member
Premium Member
Posts: 38
Joined: Sat Dec 29, 2007 9:58 am

Can any one send me the soln

Post by srinivas Guduru »

For my question can any one send the solution please
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I'd clarified what you need to do and hoped you'd put some effort into figuring out the rest but if you are looking for something more 'silver platter', then fine...

The first link constraint should be something like:

Code: Select all

Today.Role_ID = "AAAAA" or Today.Role_ID = "BBBBB" or Today.Role_ID = "CCCCC" or Today.Role_ID = "DDDDD" or Today.Role_ID = "EEEEE"
For the second link to pass all records, simple leave the contraint empty. You'll still need to use what you posted as derivations.
-craig

"You can never have too many knives" -- Logan Nine Fingers
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

you cannot populate a value in the constraint.you need to write the conditions in the derivation for a field in the output.If you want to restrict the records on the conditions then
For first o/p link contstraint :

column (Role_ID) ='AAAAA' OR column (Role_ID) ='BBBBB' OR column (Role_ID)='CCCCC' OR column (Role_ID)= 'DDDDD' OR column (Role_ID)='EEEEE'

Please clarify where you need to populate 'PPPPP'
N.Srinivas
India.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You are very right and noted pretty much everything I did in my reply. However, the post is marked as 'Resolved', something I did after receiving a private message from the OP saying that everything now worked, so I don't think they'll be back to this thread. :wink:
-craig

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