.REJECTEDCODE = 0

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
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

.REJECTEDCODE = 0

Post by bapajju »

Hello,

I am modifying an laready built code. In one of the jobs, in the constraint there is a condition specifying

LinkName..REJECTEDCODE = 0
and IsNull(Field1) <>1

Could someone help me understand the meaning of these two statements. I am facing these typr of statements for the firts time.

Thanks in advance
Bapajju
als110
Participant
Posts: 43
Joined: Fri Nov 05, 2004 11:21 am
Location: United States

Post by als110 »

if it is a constraint on the output of a transformer you only pass a record through if the input field REJECTEDCODE = 0 and if Field1 is not null
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is Field1? Normally input columns are qualified with their link name. But it could be a stage variable, I guess. Anyway, it needs not to be null for the row to be put out along this link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

Post by bapajju »

thanks. Let me be more specific.

I have one input link Say Input. I have two Output links say Output1 & Output2.

Now the Contrsaint for Outpu2 is like below:

Output1.REJECTEDCODE = 0 And IsNull(Input.Field1) <>1 . Now I got the point that IsNull(Input.Field1) <>1 means Input.Field1 has to be NULL to pass though this link.

But I am still unable to understand the part Output1.REJECTEDCODE = 0 .
What Does this mean exactly.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Keep in mind the fact that 0 is the same as 'false' or equivalent to the @FALSE system variable while 1 (actually any non-zero value) is 'true' or equivalent to the @TRUE system variable.

Check the online help for reject row handling as it goes through all this. REJECTEDCODE is non-zero (or @TRUE) when a row went down the attached link and was rejected (pushed back) by the target. This is different from REJECTED which means 'did not go down'.

So, testing for REJECTEDCODE = 0 is checking if the REJECTEDCODE is false - aka, not rejected. I prefer a different syntax when used in constraints, but it all works:

Code: Select all

Output1.REJECTEDCODE         [Output1 row was rejected]
Not(Output1.REJECTEDCODE)    [Output1 row was successful]
Both of these are simple expressions that evaluate to either true or false. Also note - just to complicate things - that the second notation could also mean no row was sent down the link - it can't be rejected if it wasn't sent in the first place. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
bapajju
Participant
Posts: 82
Joined: Wed Nov 19, 2003 11:58 pm

Post by bapajju »

Thanks Craig. I got the points. Thanks a Ton.
chulett wrote:Keep in mind the fact that 0 is the same as 'false' or equivalent to the @FALSE system variable while 1 (actually any non-zero value) is 'true' or equivalent to the @TRUE system variable.

Check the online help for reject row handling as it goes through all this. REJECTEDCODE is non-zero (or @TRUE) when a row went down the attached link and was rejected (pushed back) by the target. This is different from REJECTED which means 'did not go down'.

So, testing for REJECTEDCODE = 0 is checking if the REJECTEDCODE is false - aka, not rejected. I prefer a different syntax when used in constraints, but it all works:

Code: Select all

Output1.REJECTEDCODE         [Output1 row was rejected]
Not(Output1.REJECTEDCODE)    [Output1 row was successful]
Both of these are simple expressions that evaluate to either true or false. Also note - just to complicate things - that the second notation could also mean no row was sent down the link - it can't be rejected if it wasn't sent in the first place. :wink:
Post Reply