btree.extract ]64k (AREV Specific)
At 08 AUG 2005 01:53:37PM Aiden Massey wrote:
Arev 2.11
Indexed field 6 numeric
16,000 keys returned for index value
btree.index not performing according to instructions in 3.0 manual.
btreeFlag='
btreeOption='
btreeOption=E" ; * suppress error mesasge, "S" does not work
btreeOption=1
btreeOption='
Loop
Btree.extract("indexedField":@vm:searchValue:@fm,"FILE_NAME",dictFile,keys,btreeOption,btreeFlag)If btreeFlag ] -1 ThenGosub ProcessEndWhile btreeFlag
Repeat
Program goes into infinite loop, btreeFlag=5950 and btreeOption null
At 08 AUG 2005 02:03PM Aiden Massey wrote:
Key length=10
At 08 AUG 2005 03:41PM Victor Engel wrote:
The value 5950 indicates the total number of keys returned in your keylist. You have a value there because there are more hits than fit in 64K. BTREE.EXTRACT doesn't use a cursor, so repeated calls of the same thing do just that: the same thing repeatedly.
If you want to process more than 64K of keys you need to use an alternate method. The simplest is to use a PERFORM "SELECT …" and then use a cursor to process the list. If the case sensitivity of the index matches the case sensitivity of the environment where the select is performed, if the field is indexed, it will be used to resolve the request.
Victor
At 08 AUG 2005 09:54PM Aiden Massey wrote:
I have a function that retrieves all records for an index and processes each record to return the most current open_date. This function may be called by a multivalue symbolic so PERFORM will not work. The documentation states field 3 of the fifth parameter should return a handle.
At 09 AUG 2005 12:00PM Victor Engel wrote:
"The documentation states field 3 of the fifth parameter should return a handle."
The documentation for what? For BTREE.EXTRACT, the fifth parameter can have one of three values: null: all messages are displayed, E error messages are suppressed, S informational messages are suppressed.
BTREE.EXTRACT is limited to 64K keys. If you need more than that, you should probably look into using BTREE.READ. This is documented on Sprezzatura's SYSKNOWLEDGE for Arev (record key R101).
Victor
At 09 AUG 2005 12:18PM Matt Sorrell wrote:
Victor,
The R/Basic System Subroutines documentation covers how to return more than 64k of keys using Btree.Extract. You have to call it in a loop as it will only return up to 64k at a time.
That is what Aiden is trying to make work.
At 09 AUG 2005 12:25PM [email protected] wrote:
Looks like he might want to upgrade to a version of AREV that supports that syntax then OR use the replacement routines on one of the REVMEDIA diskettes… ;)
The Sprezzatura Group Web Site
World Leaders in all things RevSoft
At 09 AUG 2005 12:35PM Matt Sorrell wrote:
Ya know, I was just looking through docs trying to figure out when that feature was added to Btree.Extract.
I know it exists in 3.0, but I wasn't sure about before then.
At 09 AUG 2005 01:51PM Victor Engel wrote:
It's not mentinoed in the 2.1 docs, which is what I was looking at when answering the question.