Lookup issue

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
cedua
Participant
Posts: 22
Joined: Mon Nov 10, 2008 1:21 pm

Lookup issue

Post by cedua »

Hi all

I'm creating a hashed file from a query to an Oracle DB.

In another job I have the following:

Code: Select all

OCI Stage ----> Transformer----->OCI Stage
                        |
                        |
                  hashed_file
I'm trying to validate the records...so the records that are NOT in the hashed_file get inserted into the second OCI Stage but when I run the job, nothing is getting inserted....

I have tried with isnull(link_name.field) and with (link_name.NOTFOUND)

Can you help me with this please?

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

Post by DSguru2B »

If your source link count is the same as your lookup link count then that means that there are no inserts, if they are not the same then you should have inserts and if you see a count of zero on your output link then you need to peek in your log as you might have warnings.
If all to no avail then make sure your hashed file name is right. Even your metadata for the hashed file should be identical to the metadata used while creating the hashed file.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jcthornton
Premium Member
Premium Member
Posts: 79
Joined: Thu Mar 22, 2007 4:58 pm
Location: USA

Post by jcthornton »

I assume you have a constraint on the link that goes out to the hashed file.

Can't you just mark the other link - the one to the second OCI stage - as a Reject in the Transformer constraints?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's only one output link from the transformer, so it doesn't really make sense to have it as a reject link. As noted, first double-check everything - that you are referencing the right hashed file, using a proper key value, etc etc.

Then let us know what counts show in the monitor when you run the job. Specifically you have X rows into the transformer and 0 rows out but I'm curious what does it show for the number of rows on your reference link. That number is the number of successful lookups, for an 'all inserts' scenario (all hash lookup failures) that number should be zero.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jcthornton
Premium Member
Premium Member
Posts: 79
Joined: Thu Mar 22, 2007 4:58 pm
Location: USA

Post by jcthornton »

Whoops - misread it. I saw the hashed file as an output, not an input.

So, If I am understanding both the problem and Craig's explanation, the count on the hashed file link plus the count from the output link should equal the input count.

Input Count = Hashed Reads + Output Count

As long as that relation is holding true, the stage is functioning correctly.

If it is know that the input data includes records that should be output and are not, the troubleshooting needs to begin looking at how the inputs are being joined.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

jcthornton wrote:So, If I am understanding both the problem and Craig's explanation, the count on the hashed file link plus the count from the output link should equal the input count.
If my understanding of the design is correct as well - that a reference hashed file of existing keys is checked and only new keys are allowed past to be inserted into the target - then yes, those counts should 'foot' as you've noted.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You might have already checked this....but can you verify that the
a.) keys with which the hashed file is created contains the same key you expect in the reference
b.) the key in the current job under discussion is correct


Also it will be helpful if you can locate few values in hashed file which are going to target - which you think is happening. That way we are certain and have ratified the assumption.
Post Reply