Hash Rejects

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
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Hash Rejects

Post by Dsnew »

Hi all,

I am loading data from a Fact table to an Aggregate table, doing lookup on two hash files.
Some of the data gets rejected as it cannot find it in the the lookup in the hashed file.
I have defined a stage variable stgNotFound as

Code: Select all

if (hashA.NOTFOUND or hashB.NOTFOUND) then 'N' else 'Y'
Then i have added the constraint on the Aggregate table Insert as

Code: Select all

stgNotFound = 'N' 
and i have a reject file for which the constraint is

Code: Select all

stgNotFound = 'Y'. 
I still get rejects in the log of the director ??
Also the number the Output Rows + Reject Rows is not equal to the Input Rows.

Any clues as to where i am going wrong??
sjhouse
Premium Member
Premium Member
Posts: 43
Joined: Tue Nov 02, 2004 12:11 pm
Location: Minneapolis, MN

Post by sjhouse »

The reason you are getting a message in Director is that you checked the reject row box in the constraints. This will generate a warning message if any rejects are encountered.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

Another scenario could be that your hashed file is not updated, there might be some headings are not existing in the hashed file. In such a case you would get rejects, even though you have not checked the reject check box in the constraints.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Hash Rejects

Post by gateleys »

[quote="Dsnew"]

Code: Select all

if (hashA.NOTFOUND or hashB.NOTFOUND) then 'N' else 'Y'
[quote]
Have you checked if there are anly trailing spaces in your key fields? Make sure that your input comparison field is trimmed, and then try -

IF(ISNULL(TRIM(hashA)) format to look for match/mismatch.

gateleys
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: Hash Rejects

Post by gateleys »

By the way, why do you have that OR condition in the constraint? Can you tell us what you are passing to the output link. Otherwise, if contents of both hashed files are the same, you could merge all the data into a single hashed file. I am not a fan of OR in this kind of situations.

gateleys
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Post by Dsnew »

Thanks narasimha,

You are right, i did not get any rejects after I re-ran my hash jobs.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Dsnew wrote:Thanks narasimha,

You are right, i did not get any rejects after I re-ran my hash jobs.
Good. But, how about the counts, are they right?

gateleys
Dsnew
Participant
Posts: 90
Joined: Tue Apr 19, 2005 2:08 pm

Post by Dsnew »

Yes gateleys,
I am capturing the rejects in a reject file, I will later updaet my hash files with these missing values
Thanks for you inputs
Post Reply