Hash File
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 49
- Joined: Wed Dec 13, 2006 6:31 pm
Hash File
Hello Everybody, I am doing a look up against a flat file. The only column in Hash file is 'Sample' which is obviously the key. On the flat file i have Sample_Number as the key and i also have the Sample column as non key. The key expression is Sample.FlatFile=Sample.HashFile. The thing now is, even though there are records matching there are no hits coming out until i set a constraint which is similar to the key expression. Does that mean there is a problem with my hash file or am i doing something wrong?
Thanks
Thanks
Re: Hash File
That's not literally what's in your Key Expression, is it?ghostraider wrote:The key expression is Sample.FlatFile=Sample.HashFile.
It should just be something like InputLink.Sample_Number as best as I can tell from your posting.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 49
- Joined: Wed Dec 13, 2006 6:31 pm
Re: Hash File
Chulett, it is not literally what i have in my key expression but the constraint is like Link1.Sample=Link2.Sample. where Link1 is for Sequential File and Link2 for hash file.
Yeah the key expression is like what you have mentioned.
Thanks
Yeah the key expression is like what you have mentioned.
Thanks
Ok, good. However, other statements you've made are a little confusing as well. Setting a constraint on an outbound link will not effect an inbound's link ability to do a reference lookup.
And a typical lookup check would be using the Link Variable LinkName.NOTFOUND instead of checking the two values. Hard to say precisely from what you wrote, but your constraint may be equivalent and working fine depending on exactly what you are checking.
If you compare the value in the Input link to the value in the Key expression, they will be equal if the lookup succeeded. The reference value will be NULL if it fails, so the equality check would also fail.
So, after all that I'm left wondering what exactly is the problem here we are trying to solve.
And a typical lookup check would be using the Link Variable LinkName.NOTFOUND instead of checking the two values. Hard to say precisely from what you wrote, but your constraint may be equivalent and working fine depending on exactly what you are checking.
If you compare the value in the Input link to the value in the Key expression, they will be equal if the lookup succeeded. The reference value will be NULL if it fails, so the equality check would also fail.
So, after all that I'm left wondering what exactly is the problem here we are trying to solve.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 49
- Joined: Wed Dec 13, 2006 6:31 pm
-
- Premium Member
- Posts: 49
- Joined: Wed Dec 13, 2006 6:31 pm
All that is good. Now you just need a constraint to keep the unmatched records from being output. Typically, that would be:
Change the ReferenceLinkName noted above to your real link name.
Code: Select all
Not(ReferenceLinkName.NOTFOUND)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Hi,
this makes it an inner join on the ref.Sample=input.sample:
If you dont put this constraint it will be left outer join. WHich means that you should be getting matching and non matching recs from the INPUT
Thanks
Sumeet
this makes it an inner join on the ref.Sample=input.sample:
Code: Select all
Not(ReferenceLinkName.NOTFOUND)
Thanks
Sumeet
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
A hash file is a tool used for shaping blocks of hash.
A hashed file is a DataStage table particularly well-suited to key-based lookups because it determines the record location by applying a hashing algorithm to the key value.
A hashed file is a DataStage table particularly well-suited to key-based lookups because it determines the record location by applying a hashing algorithm to the key value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.