HashFileLookup
Moderators: chulett, rschirm, roy
HashFileLookup
The UtilityHashLookup function only works on the VOC file.
If I Change the code to access one of my own HashFiles (Openpath instead of Open). I get an Improper Data Type error message, no matter what!!
The sections that fails is:
Read RecFrom FileHandlers(POS), KeyField Then
Ans = Rec<1>
Is there some magic to this ?
The error message is there even if I input NULL values on key column and column number...
Any ideas anyone ?
If I Change the code to access one of my own HashFiles (Openpath instead of Open). I get an Improper Data Type error message, no matter what!!
The sections that fails is:
Read RecFrom FileHandlers(POS), KeyField Then
Ans = Rec<1>
Is there some magic to this ?
The error message is there even if I input NULL values on key column and column number...
Any ideas anyone ?
Chris
So, you copied the routine and the only change was from Open to OpenPath, yes? If that's the case, then the problem would not be with the routine itself but how you are calling it.
Can you provide an example of your calling syntax, please?
Can you provide an example of your calling syntax, please?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Re: HashFileLookup
This error message occurs when the file unit ("FileHandlers(POS)") is invalid - this occurs when your OPEN or OPENPATH has failed. Can you post that statement? You cannot just add the "path" to the the statement, as the syntax of both calls are different.nibble wrote:...I get an Improper Data Type error message, no matter what!!...
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Actually, you can as that's exactly what I've done here and it works just peachy. As noted, the syntax to call the routine is slightly different - you need to pass in the full path to the hashed file rather than just the VOC name.ArndW wrote:You cannot just add the "path" to the the statement, as the syntax of both calls are different.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I am so used to using the OPEN '','FILENAME' syntax that I didn't check to make sure that the first parameter is actually optional until I went to check after reading Craig's statement. I stand corrected, the syntax of both statements is identical.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
It's a problem that you're remembering the old days (Prime), when the "" in the OPEN statement was necessary. If my memory serves it was made optional in about version 6 of Prime INFORMATION.
Waiting for nibble to respond with code and call before chasing any red herrings.
Waiting for nibble to respond with code and call before chasing any red herrings.
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.
Changes to the code
I changed the value of the HastTable variable to contain path and filename:
HashTable = 'hasfilepath' : Arg1
When I do this change, the function manages to locate the file, if I don't, the function failes to locate the file.
The second change was change of Open statement to Openpath.
That's it !
The hasfile has one key column...
Chris.
HashTable = 'hasfilepath' : Arg1
When I do this change, the function manages to locate the file, if I don't, the function failes to locate the file.
The second change was change of Open statement to Openpath.
That's it !
The hasfile has one key column...
Chris.
chulett wrote:So, you copied the routine and the only change was from Open to OpenPath, yes? If that's the case, then the problem would not be with the routine itself but how you are calling it.
Can you provide an example of your calling syntax, please?
Chris
Calling the function
I haven't used the function in the ETL job yet, I only use the Test Function functionality.
Christer.
Christer.
chulett wrote:So, you copied the routine and the only change was from Open to OpenPath, yes? If that's the case, then the problem would not be with the routine itself but how you are calling it.
Can you provide an example of your calling syntax, please?
Chris
What does your function do for the ELSE part of the OPENPATH?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Else statement
That's the DSRMessage function call.
Chris.
Chris.
ArndW wrote:What does your function do for the ELSE part of the OPENPATH?
Chris
Error located
Seems that the problem is when the file is in cache.
If the file is in cache, in other words if this command returns true:
Locate HashTable in FilesOpened Setting POS Then
Then this section fails:
Read Rec From FileHandles(POS), Keyfield Then
With the error:
Improper data type
Why ?
Chris.
If the file is in cache, in other words if this command returns true:
Locate HashTable in FilesOpened Setting POS Then
Then this section fails:
Read Rec From FileHandles(POS), Keyfield Then
With the error:
Improper data type
Why ?
Chris.
ArndW wrote:What does your function do for the ELSE part of the OPENPATH?
Chris
Print out the value when you get the error - that might give you a clue as to what is happening. It won't print if it is a proper file pointer, but the error message you are getting already tells us that it isn't correct.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>