about @False

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
ranga1970
Participant
Posts: 141
Joined: Thu Nov 04, 2004 3:29 pm
Location: Hyderabad

about @False

Post by ranga1970 »

Hi,
I have a job which had one input link and four output link out of them 3 them have Constraint @ false and one nothing, no derivationsa no stage variables, what does this @False constraint do, any help appreciated
RRCHINTALA
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

@FALSE is a BOOLEAN variable. @TRUE is the opposite. In a constraint, the expression must either be true or false. So, to always make a row go down a link, putting @TRUE causes it to do so. Putting @FALSE prevents any rows from going down the link.

Why do this in a constraint? For testing or debugging purposes, putting "AND @FALSE" into a constraint will preserve the expression but disable any rows from continuing.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ranga1970
Participant
Posts: 141
Joined: Thu Nov 04, 2004 3:29 pm
Location: Hyderabad

Post by ranga1970 »

KC,
Ther is no lookup, then @False means nothing should go in right? is there some thing do with any keys
The job

Code: Select all

Inputlink  ------- @false -- outputlink1(all the primary key values)
               -------@False --  Ouputlink2(all primary keys + some values)
               -------@False --  Ouputlink2(all primary keys + All values)
               ------------------ Outputlink4(all keys+all values)
As for my understanding no data should go any time to first three links and all data should go to 4th link

but my doubt is will some data go to any of the first three liks if any of the primary key (one of the 5 in this case) is null value, please throw some light on this
thanks
ranga
RRCHINTALA
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

@FALSE will prevent any row from being passed along this link.

This is calculated before any output column derivations are executed, so that neither the incoming values, nor anything else, can affect that decision. So, in your design, there will be zero rows sent along the first three output links.

I suspect that's not what you want to occur, but that's what you've designed. And, therefore, your statement (your understanding) that "no data should go any time to first three links and all data should go to 4th link" is perfectly correct.

Why not write out a specification (in English, or whatever is your native language) about what you want to occur, then convert this specification into a DataStage design? I still do this, after more than eight years' experience with the product. It's a great focussing exercise.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Make sure you use @FALSE, not @False. @FALSE is equated to 0, whereas @False is a non-existent variable. It still works, only because it is unassigned and would therefore give a message stating such and that ZERO would be used.

There is no reason to build links and then constrain with @FALSE, unless you are temporarily disabling the flow of data down those links. The contents of an output link are only calculated if the constraint is met. Stage variables are ALWAYS calculated for every row, as they are not associated to an output link.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply