|
|
NM and CM callable.
Moves a record pointer forward or backward on a magnetic tape or disk file,
spaces physical records on magnetic tape files and logical records on disk
files.
Syntax
I16V I16V
FSPACE (filenum, displacement);
Parameters
- filenum
16-bit signed integer by value (required)
Passes the file number of the file on which spacing is to be
done.
- displacement
16-bit signed integer by value (required)
Passes the number of logical records for buffered disk files, or blocks
for NOBUF files and all tape files, to be spaced over, relative
to the current position of the logical record pointer.
A positive value signifies forward spacing, a negative value signifies
backward spacing. The maximum positive value is 32,767, the maximum
negative value is -32,768.
If RIO access is used, displacement includes both active
and inactive records. Attempts to backspace beyond the beginning of the
file are ignored by the system. The logical record pointer points to
record 0 (the first record), and no error codes are returned.
Operation Notes
The FSPACE intrinsic cannot be used with variable-length record files,
message files, or with spooled files on disk. An attempt to use this intrinsic
on such files results in CCL (1), and the logical record pointer is
left at its current position.
FSPACE intrinsic fails with a CCL condition:
(KSAM) The logical record pointer is repositioned in key sequence. The
spacing is based on the primary key unless an alternate key has been
specified in a prior call to FFINDN, FFINDBYKEY, or
FREADBYKEY.
Condition Codes
- CCE (2)
Request granted.
- CCG (0)
Request denied. An end-of-file indicator was encountered during
spacing. For disk files, this is the file limit, and the logical record
pointer is not changed. For magnetic tape files, this is the end-of-file
mark, and the logical record pointer points to the (logical) end-of-file.
The magnetic tape is positioned to one record past the file mark on the
tape. For labeled tape, the logical record pointer is at the file
mark.
- CCL (1)
Request denied. An error occurred; for example, the file resides on a
device that prohibits spacing. Not allowed with append access.
Related Information
- Manuals
Accessing Files Programmer's Guide
Using KSAM XL
KSAM/3000 Reference Manual
|