Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (H-K)
Guardian Procedure Calls Reference Manual522629-013
7-62
KEYPOSITION[X] Procedures
(Superseded by FILE_SETKEY_ Procedure)
When saving the current position in a relative or entry-sequenced file with no
alternate keys, the SAVEPOSITION procedure requires an additional three words
in the
positioning buffer, for a total of seven words when read-reverse
positioning is in effect. If you have programs currently using SAVEPOSITION with
a four-word
positioning buffer, please note this change.
Read-reverse action on current and next record pointers
Following a call to READ when reverse-positioning mode is in effect, the
next-
record-pointer contains the record number or address which precedes the
current record number or address.
Following a read of the first record in a file (where
current- record-pointer
= 0) with reverse positioning, the
next-record- pointer will contain an invalid
record number or address since no previous record exists. A subsequent call to
READ would return an “end-of-file” error, whereas a call to WRITE would return an
“illegal position” error (error 550) since an attempt was made to write beyond the
beginning of the file.
KEYPOSITION and file-system error 21
If any of the following conditions are true, error 21 is returned by KEYPOSITION:
If the primary file is a key-sequenced file and one of the following is true:
key-specifier is omitted or 0 and key-length is greater than the key
length defined for the primary file.
compare-length is greater than key-length.
If the key-specifier is not zero and one of the following is true:
key-length is greater than the sum of length of the alternate-key field
and the length of the primary key of the file.
key-length is less than or equal to the length of the alternate-key field,
and
compare-length is greater than key-length.
key-length is greater than the length of the alternate-key field and the
primary file is not key-sequenced, and the difference of
key-length and
compare-length is less than 4.
key-length is greater than the length of the alternate-key field and the
primary file is not key-sequenced, and the
key-length is less than the
sum of the length of the alternate-key field and the length of the primary
key of the file.
KEYPOSITIONX error
In addition to the errors returned from KEYPOSITION, error 22 is returned from
KEYPOSITIONX in either of the following cases:
the address of the key-value parameter is extended, but no segment is in
use at the time of the call or the segment in use is invalid.