To Check 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
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

To Check NULL

Post by Shree0410 »

How to check if a Filed is null, Is there a IsNull function?
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi Shree,
Yes, there is a IsNull function.
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

my requirement is to populate 0000's if the filed is null
I tried If IsNull(myfield) Then 0000, the expression is in red, some syntax error?
Krazykoolrohit
Charter Member
Charter Member
Posts: 560
Joined: Wed Jul 13, 2005 5:36 am
Location: Ohio

Post by Krazykoolrohit »

Add else to it.

If IsNull(myfield) Then 0000 Else myfield
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi Shree..
Use the expression given by KrazyKoolrohit.

Code: Select all

Add else to it. 

If IsNull(myfield) Then 0000 Else myfield 
Shree0410
Participant
Posts: 70
Joined: Tue Nov 29, 2005 7:25 pm

Post by Shree0410 »

guys, I am so sorry to post simple ones like this, I have used this many times before and looks like I am getting too dependent on this site at times, just the moment I see a red on the screen, I come here and post it rather than 't h i n k' a while..
meena
Participant
Posts: 430
Joined: Tue Sep 13, 2005 12:17 pm

Post by meena »

Hi Shree..
Do not feel so sorry. This site is to help you and everyone are very cool. I really see DS gurus here.Nothing to feel bad. You will get it by yourself, if not our Gurus are here.
Shree0410 wrote:guys, I am so sorry to post simple ones like this, I have used this many times before and looks like I am getting too dependent on this site at times, just the moment I see a red on the screen, I come here and post it rather than 't h i n k' a while..
All the best..
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea: If you right-click on a red expression, you can choose "Validate Expression" from the menu, and DataStage will report t you what the parser in the Expression Editor believes is wrong with your syntax.

There is also a Transform called NullToZero that you may prefer to use - though it only gives a single zero. You could apply a Fmt() function to pad that with leading zeroes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply