comparing with null values

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
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

comparing with null values

Post by dnat »

Hi,

When we compare two fields

If (link1.A=Link1.B) then 1 Else 0

Now when Link1.B is a null value what would be the result?
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

The row is a reject
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
dnat
Participant
Posts: 200
Joined: Thu Sep 06, 2007 2:06 am

Post by dnat »

what would be the value..1 or 0?
basu.ds
Participant
Posts: 118
Joined: Tue Feb 06, 2007 12:59 am
Location: Bangalore

Post by basu.ds »

reject means '0'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If link.B is null then (link.A = link.B) is null.
The rule in server jobs (in DataStage BASIC) is that, if the test expression is null, then the Else path is taken, on the grounds that one can not assert that null is "true". The Else path is taken if the expression is not true (which is not necessarily the same thing as "false").
Welcome to the world of no data types, where rules of this kind are necessary.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

And welcome to E.F. Codd's world of three-valued logic: True, False and Who the Heck Knows. :wink:
-craig

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