How to avoid NULL to reject - in SWITCH case

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

DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Kumar,
Did u try handling it with the IF ISNULL(LINKNAME) logic?
I had this problem as well, you might want to check the logic for the condition too which is defaulted to Reject. ( this will be in a lookup stage).
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

This post was started for discussing the condition check for Null in switch stage. Where we cant use IF ISNULL(LINKNAME) logic in that. Later this post has been hijacked to experiment, how to hold a NULL value in Decimal/dfloat, apparently some of us are getting 0s instead of NULL in the nullable field.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ThilSe
Participant
Posts: 80
Joined: Thu Jun 09, 2005 7:45 am

Re: How to avoid NULL to reject - in SWITCH case

Post by ThilSe »

kumar_s wrote:Hi all,
In input stage i have a column STATUS which cant have Y or N or null. I used switch to seperate to two pipeline. null should go to N link. Bul i can handle null value to flow to a stream, it goes to Reject link. I tried with '' , "", @NUL, @NULL.STR , NULL but doesent work. But i can make it up with transformer stage with "".
STATUS is Varchar with 1 byte length. Can any one help me out.

Thanx in advance
-kumar
Kumar,

Your source datatype is Varchar. So if the input value is empty, it is assuming it to be a empty string i.e. "" and not as null. So i think should be checking for STATUS='' instead of "STATUS is null" or something else.

Hope this helps, even if the reply is too late...

Warm regards
Senthil
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Re: How to avoid NULL to reject - in SWITCH case

Post by kumar_s »

ThilSe wrote:
kumar_s wrote:Hi all,
In input stage i have a column STATUS which cant have Y or N or null. I used switch to seperate to two pipeline. null should go to N link. Bul i can handle null value to flow to a stream, it goes to Reject link. I tried with '' , "", @NUL, @NULL.STR , NULL but doesent work. But i can make it up with transformer stage with "".
STATUS is Varchar with 1 byte length. Can any one help me out.

Thanx in advance
-kumar
Kumar,

Your source datatype is Varchar. So if the input value is empty, it is assuming it to be a empty string i.e. "" and not as null. So i think should be checking for STATUS='' instead of "STATUS is null" or something else.

Hope this helps, even if the reply is too late...

Warm regards
Senthil
Hi Senthil,
Thanks for your comments.

Code: Select all

I tried with '' , "", @NUL, @NULL.STR , NULL but doesent work.
Hope you could find this in my first post. But never mind. I totally replaced the stage at present.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Did you also try removing the Reject status in the stage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

That was one of the post of last year. Now i dont even recall the job available in my project. I wish these reply could have been at six month back. :wink:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply