Hashfile Issues

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
Aravind
Participant
Posts: 16
Joined: Mon Dec 27, 2004 4:17 pm

Hashfile Issues

Post by Aravind »

Job design is like this

Folder--> XML Parser --> Hashfile1 ---> Transfomer---> Hashfile2.

I have defined the Hashfile2 with 3 keys and one of the keys is formulated as the concatenation of 10 fields. The issue that i am facing is whenever a xml tag is missing or if the value for a tag is null, the key forumulated by this filed is getting populated as null evenif I have mentioned the field not to be nullable.Can a key field of hashfile be null.


2 Dstage job design


Hashfile1 ------>
Transfomer-------> Hashfile3
Hashfile 2 ------>


In Hashfile1 is the primary link and the constraint specified in the transformer is (isnull(keycolumn in hashfile2). Hence I expected null values for fields in Hashfile3 which have the derivation from hashfile2. But this is not the case when the key column in hashfile1 is null.

Is this a expected result if the null values are not handled?
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

It's a quirky thing, but yes a column in a multi-column key can be null. The "nullable" metadata doesn't matter. If you don't want these rows, you must put a constraint in to check for these. If a hash file only has one column as a key, it cannot be null. The rationale is that a multi-column key is really a concatenated string, so a column can be null, it's just treated as a blank.

In your second question, is a row being found for reference? Looking at the link monitor will show if a row is being found. If a row is not found for reference, then all column values on that not-found row will be @NULL. If you are getting values, then you are getting a row on reference.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Aravind
Participant
Posts: 16
Joined: Mon Dec 27, 2004 4:17 pm

Post by Aravind »

Thanks Kenneth.
In the second scenario,
The lookup hashfile I am using is having mutlikey. One of the key columns is having a null value and this key column happens to be the one checked for null in the transfomer constraint. So is there a chance that this particular record can pass through eventhough the lookup fails.
Post Reply