Using KSAM/XL and KSAM 64 (32650-90886)

138 Chapter9
KSAM Intrinsics
FREADC
FREADC
Reads a logical record in physical sequence from a KSAM file to the target.
Syntax
I16 I16V LAI 16V
lgth
:=FREADC(
filenum,buffer,length
);
Functional Return
lgth
16-bit signed integer by value (assigned functional return)
Returns the length of the information transferred.
•If
lgth
is positive, it is a halfword count.
•If
lgth
is negative, it is a byte count.
•If
lgth
is 0, the position is identified, but the data is not returned.
Parameters
filenum
16-bit signed integer by value (required)
Passes the file number of the file to be read in physical record sequence.
buffer
logical array (required)
Returns the transferred record. It must be large enough to hold all the
information to be read.
length
16-bit signed integer by value (required)
Passes the number of halfwords or bytes to be transferred. If
length
is
positive, it is the length in halfwords; if negative, it is the length in bytes.
If, zero, no transfer occurs. If
length
is less than the size of the record to
be transferred, only the first
length
halfwords or bytes are transferred
from the record. If the
length
is larger than the physical record size, only
the physical record length is transferred.
Operation Notes
This intrinsic reads the advance flag and advances to the next record if the flag is set to
TRUE. It positions only the physical record pointer to the appropriate record. Deleted
records are skipped. When its function is completed, it sets the advance flag to TRUE.