Guardian Procedure Calls Reference Manual (G06.25+)
Guardian Procedure Calls (S)
Guardian Procedure Calls Reference Manual—522629-013
14-4
SAVEPOSITION Procedure
(Superseded by FILE_SAVEPOSITION_ Procedure)
Parameters
filenum input
INT:value
is a number of an open file, identifying the file whose positioning block is to be
obtained.
positioning-block output
INT:ref:*
returns the positioning information for the file’s current position. The buffer must be
large enough to hold the entire block of information. The following shows how to
calculate the required buffer size in words. (The maximum value for alternate key
length is used to assure that the buffer is always large enough, although the
system might return shorter blocks in specific cases.)
For key-sequenced files where positioning is performed by:
•
Primary key, the count is calculated by
7 + (primary-keylen + 1) / 2
•
An alternate key, the count is calculated by
7 + (max-alternate-keylen + primary-keylen + 1) / 2
For unstructured files and for entry-sequenced and relative files where no alternate
keys exist, the count is 4. For entry-sequenced and relative files with alternate
keys, where positioning is performed by:
•
Primary key, the count is 7
•
An alternate key, the count is calculated by
7 + (max-alternate-keylen + 4 + 1) / 2
positioning-blksize output
INT:ref:1
returns the actual number of words in the positioning block.
Condition Code Settings
< (CCL) indicates that an error occurred (call FILE_GETINFO_ or FILEINFO).
= (CCE) indicates that SAVEPOSITION is successful.
> (CCG) indicates that the file is not a disk file.