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

150 Chapter9
KSAM Intrinsics
FWRITE
FWRITE
Writes a logical record from the buffer to a file.
Syntax
I16V UDS I16V U16V
FWRITE(
filenum,buffer,length,controlcode
);
Parameters
filenum
16-bit signed integer by value (required)
Passes the file number of the file to be written on.
buffer
user-defined structure (required)
Passes the record to be written.
length
16-bit signed integer by value (required)
Passes the number of halfwords or bytes to be written to the record. If this
value is positive, it signifies halfwords; if negative, bytes. Zero indicates
that no transfer occurs.
If
length
is less than the record size, the remaining portion of the record is
padded with the fill character that is specified during the file creation. The
default for ASCII is blank. The default for binary is binary zero.
If
length
is larger than the logical record size, the FWRITE request is
refused and CCL is returned.
controlcode
16-bit unsigned integer by value (required)
This parameter must be specified to satisfy internal requirements, but it is
ignored.
Operation Notes
This intrinsic does not read the advance flag. It positions the logical record pointer and the
physical pointer to the appropriate record. When its function is completed, it sets the
advance flag to FALSE.
When the FWRITE intrinsic is executed, the logical record pointer is set to the record
immediately following the record just written. When an FWRITE call writes a record beyond
the current logical end-of-file indicator, this indicator is advanced. If the physical bounds of
the file are reached, CCG is returned.