Accessing Files Programmer's Guide (32650-90885)

114 Chapter7
Record Selection and Data Transfer
Control Operations
also set the the
inhibit buffering option
parameter to NOBUF in your HPFOPEN/FOPEN
call or FILE command.
When you read from a file in multirecord mode, you may not read beyond the EOF
(end-of-file marker). When you write to a file in multirecord mode, you may write only up
to the block containing the file limit. If your transfer exceeds its limit, a condition code of
CCG is returned, data is transferred only up to the limit, and the FREAD intrinsic returns a
transfer length of 0.
NOTE
To obtain the actual transfer length for your data use the FCHECK intrinsic, as
described in the MPE/iX Intrinsics Reference Manual. The transfer length is
returned in the TLOG parameter of FCHECK.
Control Operations
There may be times when you want to move the record pointer to a particular place
without necessarily transferring any data. There are three general categories for this type
of record selection:
Spacing: Move the record pointer backward or forward.
Pointing: Reset the record pointer.
Rewinding: Reset the pointer to record 0.
Spacing
To space forward or backward in your file, use the FSPACE intrinsic. Its syntax is
FSPACE(filenum,displacement);
The displacement parameter gives the number of records to space from the current record
pointer. Use a positive number for spacing forward in the file or a negative number for
spacing backward.
You can use the FSPACE intrinsic only with files that contain fixed-length or
undefined-length records; variable-length record files are not allowed. The FSPACE
intrinsic may not be used when you have opened your file with APPEND access; the file
system returns a CCL condition if you attempt to use it in this case. Spacing beyond the
EOF results in a CCG condition, and the record pointer is not changed.
Pointing
To request a specific location for the record pointer to indicate, use the FPOINT intrinsic. Its
syntax is
FPOINT(
filenum
,
recnum
);
Use the recnum parameter to specify the new location for the record pointer; recnum is the