PX Transformer Constraint Otherwise Not Working Correctly

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
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

PX Transformer Constraint Otherwise Not Working Correctly

Post by jweir »

Hello all,

It seems my constraints on my transformer are not working correctly (or the way I think it should work).

Say for my input, I have 1000 records. I have five output links from my transformer. Below are the four constraints. The other output link is the Otherwise.

Code: Select all

 C1 = Len(Ln_ds_src.SBB) <> 4 Or
 AlNum(Ln_ds_src.SBB) = 0

C2 = Ln_ds_src.Date < '2000-01-01'

C3 = Ln_ds_src.NumberId = 'UNKNOWN'

C4 = Len(svCIIcheck) < 6 And svSTSalphanum = 0

C5 = Otherwise
Out of the 1000 records, 68 get passed to the C4 output link. However, all 1000 records are being passed to the Otherwise link.

Can anyone shed some light as to why this would be happening and how I can resolve this?

Thanks in advance.
Jweir

--- If strength were all, tiger would not fear scorpion.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Only the obvious observation that none of your records meet any of the critera on the first four constraints. You would need to provide values of the tested fields in order for us to decide that one way or the other.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Thanks Ray.

However, there are records that are meeting my criteria. If you re-read above, there are 68 records that get passed to by C4 constraint. Also, all 1000 records get passed to the Otherwise link. So it seems that some records are going down two output links.
Jweir

--- If strength were all, tiger would not fear scorpion.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Check the output link execution order. Is the Otherwise/Log link being executed first?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Ray,

It is not the first, but it is the second condition when I open the constraints window. I am not sure how to move the order of constraints around, but I will figure it out and put the Otherwise last and see if that works.

Thanks.
Jweir

--- If strength were all, tiger would not fear scorpion.
jweir
Participant
Posts: 134
Joined: Wed Aug 04, 2010 12:31 pm

Post by jweir »

Ray,

You are correct. The reason I was getting double matches was because the Otherwise link was second in order of execution. I moved the Otherwise link to last (by simply detaching and re-attaching the link to the transformer) and it ran with correct number of outputs.

I guess it never hit me that order of execution applies to constraints too.

Thanks! Marking as resolved.
Jweir

--- If strength were all, tiger would not fear scorpion.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There is a Link Execution Order tool in the Transformer stage toolbar.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply