Null handling

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
benny.lbs
Participant
Posts: 125
Joined: Wed Feb 23, 2005 3:46 am

Null handling

Post by benny.lbs »

Thanks for reading !

It is still a null handling question, my case as below.

Input : FieldA, FieldB
Output: FieldC

In transformer stage, derivation within FieldC

If IsNotNull(FieldA) Then
FieldA
Else
FieldB

As I know, there is handle_null() function within Modify stage.

FieldC = handle_null(FieldA, value)

here, it is only support value ? Can not be a field from input link ?

If yes, any other stage except transformer can fulfill my requirement.
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
why not test it your self?
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
naren6876
Participant
Posts: 233
Joined: Mon Feb 07, 2005 7:19 pm

Re: Null handling

Post by naren6876 »

why dont u test like this
If Not(IsNull(FieldA)) Then
FieldA
Else
FieldB
[/quote]
gh_amitava
Participant
Posts: 75
Joined: Tue May 13, 2003 4:14 am
Location: California
Contact:

Post by gh_amitava »

Benny,

Are you sure a Null is there or Space ? For both of them you can use the following code,

If (IsNull(X) = 1 Or Trim(X) = "") Then <Action1> Else <Action2>

To check whether Null is coming or not you can use a Peek stage .

Regards
~Amitava
Post Reply