Regarding NULL

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
sekr
Participant
Posts: 14
Joined: Tue Dec 13, 2005 3:50 am

Regarding NULL

Post by sekr »

Hi frnds !

i want to know wethere !

1) Trim(input," ","B") gives the result empty i.e "",
whether this "" equals to @Null..


so if it is Same can we specify Trim(input," ","B") = @Null

so, ""=@null specify yes or no
In Adv Thanks
---------s
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

sekr,

why haven't you tested this yourself? You can go into the Manager and create your own DataStage routine and test it with your question all within a minute...

The answer is that the output from TRIM() on any string that is not null will also be not null. In your example it will be the empty string "", of length 0. This same approach applies to all DataStage builtin functions - you won't get a NULL as an answer unless one of your inputs was also a NULL value.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

1. Trim() never results in a zero-length string.

2. A zero length string ("") has a known value. Null is unknown. You can never claim that they are equal (or even unequal).
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 »

ray.wurlod wrote:Trim() never results in a zero-length string.
Never? I was under the impression that if I trim a string with all spaces I would end up with a zero-length string. And testing seems to hold that out, unless something else is going on:

Code: Select all

Len(Trim("      "))
Returns a zero. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

I guess Ray ment to say, Trim() can never retrun NULL.

-Kumar
Post Reply