Guardian Procedure Calls Reference Manual

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
indicates that an error occurred (call FILE_GETINFO_ or FILEINFO).< (CCL)
indicates that SAVEPOSITION is successful.= (CCE)
indicates that the file is not a disk file.> (CCG)
Considerations
For relative and entry-sequence files that have no alternate keys. SAVEPOSITION requires a
seven-word positioning-block if read-reverse is the current reading mode (see
KEYPOSITION[X] Procedures (Superseded by FILE_SETKEY_ Procedure) (page 750)).
The SAVEPOSITION procedure cannot be used with files that are larger than approximately
2 gigabytes, including both Enscribe format 2 and OSS files. If an attempt is made to use the
SAVEPOSITION procedure with these files, error 581 is returned. For information on how to
perform the equivalent task with files larger than approximately 2 gigabytes, see the
FILE_SAVEPOSITION_ Procedure (page 504).
Increased key limits for format 2 key-sequenced files are not supported
The SAVEPOSITION procedure does not support the increased key limits for format 2
key-sequenced files (in H06.28/J06.17 RVUs with specific SPRs and later RVUs) because it
cannot handle keys longer than 255 bytes. If REPOSITION is passed a positioning-block
generated by SAVEPOSITION for a key-sequenced file with a key longer than 255 bytes, an
error 41 is returned. For information on how to perform the equivalent task for key-sequenced
files with keys longer than 255 bytes, see the FILE_SAVEPOSITION_ Procedure (page 504).
In files that support insertion-ordered duplicate alternate keys, each alternate key includes four
additional words for a timestamp.
Example
CALL SAVEPOSITION ( FILE^NUM , POSITION^BLOCK );
1258 Guardian Procedure Calls (S)