constraint in transformer

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
India2000
Participant
Posts: 274
Joined: Sun Aug 22, 2010 11:07 am

constraint in transformer

Post by India2000 »

Hi,

I have a constraint in the transformer

X=1 and Y=1 and @False

this evaluates to zero and nothing pass thro the transformer.

What is the use of @False in this expression when it should be @true to evaluate the condition to true and pass values to the output.

Can anyone clarify me wit this ?


Thanks
meet_deb85
Premium Member
Premium Member
Posts: 132
Joined: Tue Sep 04, 2007 11:38 am
Location: NOIDA

Post by meet_deb85 »

Why are you using @True as a constraint, the compiler replaces @True with 1 and @False with 0.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Re: constraint in transformer

Post by BI-RMA »

As meet_deb85 pointed out correctly, @False is just a more 'visible' way of expressing 0 as a boolean.

In your expression you do not compare @False to anything. So the last condition will never become true and as a result the whole expression will always turn out to be false. You will need to specify which condition has to be false to make the expression as a whole true.
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

India2000 wrote:What is the use of @False in this expression
I'm guessing someone added it (as part of their debugging / bottleneck investigation) to shut down that link... and then forgot to remove it later. Or are still investigating. Or that link no longer needs to ever send rows down it and they wanted to preserve the original constraint.

In my world, there would be an annotation explaining that or something would be written in one of the General property areas that support that same concept - documentation!


Note to OP: moved my answer over from your other copy of this same question to here and deleted the duplicate post. Please do not post the same question in multiple forums! And this one is getting moved to the General forum.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Your contstraint is the same as @False alone. You don't need to add @True or @False to any constraint. Just leave it as X=1 And Y=1.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:!: Before you change anything, you need to understand why it is there.
-craig

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