NOT FOUND CONDITION

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
raj_cipher
Participant
Posts: 90
Joined: Mon Dec 08, 2003 4:48 am
Location: Chennai

NOT FOUND CONDITION

Post by raj_cipher »

Hi ,

I have a doubt regarding the NOTFOUND condition.
My job looks like
lukup(OLEDB)
|
|
V
FILE ----> Transformer -------> FILE

My requirement is if lukup found means populate the looked up valuee else populate input value

I gave the condiotion if link.NOTFOUND = 0 THEN lookedupvalue else input value

I'm not gettingthe desired result. i.e If the look up doesn't have matching value means it is populating spaces.If look up returns means it is populating the looked up value.

Am i missing anything here ? What should i do to get the input value in case of look up not neturning value.The same situation works fine with ODBC look up.
Think Ahead,
Raj.D
raj_cipher
Participant
Posts: 90
Joined: Mon Dec 08, 2003 4:48 am
Location: Chennai

the look up should point to the transformer

Post by raj_cipher »

oops ! !!!!!!!!
the look up should point to the transformer
Think Ahead,
Raj.D
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As far as I know, these are boolean values and not meant to be used in quite the way you are using them. You should simply say:

Code: Select all

if link.NOTFOUND Then input value Else lookedup value
I'm not sure what you mean about the spaces, but give it a shot like this and see how that works for you.

I remember (back in the day) when these variables were first introduced - they didn't always work correctly. :? We backed off from them and went back to the 'old way' of checking for nulls in a lookup key and I've never really used them since. For whatever that is worth. :lol:
-craig

"You can never have too many knives" -- Logan Nine Fingers
tomengers
Participant
Posts: 167
Joined: Tue Nov 19, 2002 12:20 pm
Location: Key West

Post by tomengers »

We found that NOTFOUND was solid when used in a DS390 job to test results of a DB2 referential read ... but returned variable results when used in a Server job to test Hash success.

... tom
ds_developer
Premium Member
Premium Member
Posts: 224
Joined: Tue Sep 24, 2002 7:32 am
Location: Denver, CO USA

Post by ds_developer »

I have never had any problem with NOTFOUND. We use it extensively. You need to know your data:

If you trim the key field when writing to a hashed file then you need to trim your key expression when trying to match (this is a hashed file example, but you get the idea).

John
Post Reply