Is Null Function

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
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Is Null Function

Post by sri75 »

HI,

I have one question on ISNULL() function.

I used ISNULL() function in transormer stage in few jobs to check the column value if it has null or not.
First I tested jobs in test, all went fine.I moved code to production as is.out of three jobs 2 ran fine.one got aborted with error'' trying to setISNULL to not nullable column''
But I made that column as nullable.

Another quesion

in production ,i see different elapse time for one job everyday.

It has one sourcce stage ,10 lookupstages ang 3 transformers and one agg.
Do you have any idea, what could be the problem.
Can you please help me ?

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

Post by DSguru2B »

The job that is failing, is it loading to a table. You might have that particular column set as nullable at the datastage end but if its not nullable in the database, it will generate error.
As for the run times, it depends upon the data volume, if network is involved, then network traffic etc etc.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

ISNULL function

Post by sri75 »

Thanks for your quick reply

Not loadind data into table.storing i dataset
the column say XXXX ,that is coming from source is nullable

After source table I have transformer stage .I put this expression in stage variable
If IsNull(XXXX) then 123 Else If XXXX = 0 Then 123 Else XXXX

and I assigend this stgage variable to output column YYYYYwhich is not nullable.Job is aborting at transformer stage

the same logic worked in other jobs.
now to run the aborted job in production, I removed ISNULL function from expression If XXXX = 0 Then 123 Else XXXX
and checked this function in source query like NVL(XXXX,123).It went fine.
Still I am wondering how come it worked for one job for not the other.

For second question

Usually we process same no of records every day say 500000.Is it because of overloading of etl server or any other issue.Can you please explain

Thanks






DSguru2B wrote:The job that is failing, is it loading to a table. You might have that particular column set as nullable at the datastage end but if its not nullable in the database, it will generate error.
As for the run times, it depends upon the data volume, if network is involved, then network traffic etc etc.
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Sri, There is nothing wrong with your IsNull statement. The only issue might be the Datatype of that field , sometimes it will behave like this if you are having some date or Timestamp fieds. For the other issue it might be possible that server is getting overloaded or network traffic as suggested. Try doing a cleanup and check whether that resolves your issue.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

ISNULL() Function

Post by sri75 »

us1aslam1us wrote:Sri, There is nothing wrong with your IsNull statement. The only issue might be the Datatype of that field , sometimes it will behave like this if you are having some date or Timestamp fieds. For the other issue it might be possible that server is getting overloaded or network traffic as suggested. Try doing a cleanup and check whether that resolves your issue.
Thanks for your reply.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Re: ISNULL() Function

Post by kumar_s »

sri75 wrote: Thanks for your reply.
Does it eliminate your warning. If so, pls mark the topic as resolved.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply