Return values from Lookup stage

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
learnpx
Participant
Posts: 4
Joined: Wed Mar 16, 2005 2:15 pm

Return values from Lookup stage

Post by learnpx »

What does a lookup stage return for Character fields for unmatched key values?

I am trying to apply IsNull() function for a character value that is being returned from a DB2 table. But it is not working.

Do we need to set any environmental variable to make the IsNull function work?

Thanks in advance
dsedi
Participant
Posts: 220
Joined: Wed Jun 02, 2004 12:38 am

Post by dsedi »

For unmatched key values of Character fields, lookup stage returns NULL value. this is true only if you would select If Not Found property as CONTINUE in stage properties.

IsNull() function should work for charecter fields.do some cross checks..otherwise try isNull(input)=@true or simply use len(input)=0.

Edi
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post by roy »

Hi,
a good practice IMHO would be also to:

build a test case and check it out,
write the results to a sequntial file and examine what you got in each case.

you might want to cross reference the results you got with any documentation you might find.

IHTH,
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
gh_amitava
Participant
Posts: 75
Joined: Tue May 13, 2003 4:14 am
Location: California
Contact:

Post by gh_amitava »

LearnPX,

IsNull() function should work on character field. Sometime it may not work on number field. Then we need to sue NullToZero() function. Also sometime IsNull() = 0 does not work. So better to use IsNull()=1 or IsNotNull() = 1.

Regards
~Amitava
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

1. APT_STRING_PADCHAR plays a very important part on this.

2. If you want to use NULL as a value to identified failed matches, you need to ensure that BOTH input and reference link fields are Nullable, along with the output link field for the lookup. Yes, you do need to set the 'Continue' option as mentioned earlier.

3. If you can not be nullable, or you are directly pulling from the database which is not nullable, then APT_STRING_PADCHAR is used to fill in the 'null' field. The null flag is NOT set in this case, even if the output link is nullable.
Post Reply