isnull() function

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
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

isnull() function

Post by deva »

Hi all
I am using 7.1 datastage v. windows xp.
I have 4 fields, circuit, phn, bill_info, bill
I have query,

we need to load the data into bill_info where ,

if circuit is null take the data from phn. and bill = 'phn'
if phn is null get the data from circuit.and bill='crc'

I given like : bill_info= if isnull(circuit) then phn else circuit.

Please help me on this.

Thanks in advance...
Last edited by deva on Wed Jun 06, 2007 12:14 pm, edited 1 time in total.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Your code looks fine. Is there something thats not working?
Have you considered the scenario in which both circuit and phn are null? Then what?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
deva
Participant
Posts: 104
Joined: Fri Dec 29, 2006 1:54 pm

Post by deva »

DSguru2B wrote:Your code looks fine. Is there something thats not working?
Have you considered the scenario in which both circuit and phn are null? Then what?
no actually if we have circut we populate curcuit value into bill_info and we have another field say bill , we hotcode bill = crc,
if we have phn then we populate phn value into bill_info and we hotcore bill = phn
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You are saying the same thing over and over.
Tell me this, how will you handle the following:
What if both are not null?
What if both are null?
and between the two, which one take precedence (i.e, which one to check first)?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply