Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (P)
Guardian Procedure Calls Reference Manual522629-013
12-29
POSITION Procedure
(Superseded by FILE_SETPOSITION_ Procedure)
Condition Code Settings
< (CCL) indicates that an error occurred (call FILE_GETINFO_ or FILEINFO).
= (CCE) indicates that the POSITION was successful.
> (CCG) indicates no operation;
filenum does not designate a disk file.
Considerations
POSITION does not cause the disk heads to be repositioned (at least until a
subsequent data transfer is initiated).
POSITION cannot be used with Format 2 files if the file was opened with the "Use
64 bit keys" choice to FILE_OPEN_ (which is necessary to access a file with a file
size of over 2 GB). If an attempt is made to use the POSITION procedure with
such files, error 581 is returned. See the FILE_SETPOSITION_ Procedure
for
information on how to perform the equivalent task with Format 2 files.
Unstructured files
File pointers after POSITION
After a successful call to POSITION for an unstructured file, the file pointers
are:
current^record^pointer := record-specifier;
next^record^pointer := record-specifier;
Value of record-specifier for unstructured files
Entry-Sequenced
Files
The
record-specifier is a 4-byte record-addr (the
primary key), whose format depends upon the file's block
size as follows:
Block size Number of bits for
block number
Number of bits for the
relative record number
within that block
4096 20 12
2048 21 11
1024 22 10
512 23 9
In all cases, the block number occupies the leftmost bits,
and the record number occupies the rightmost bits.
Refer to the
Enscribe Programmer’s Guide for information
about
record-addr.