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

148 Chapter9
KSAM Intrinsics
FUPDATE
FUPDATE
Updates the contents of a logical record in a file.
Syntax
I16V UDS I16V
FUPDATE(
filenum,buffer,length
);
Parameters
filenum
16-bit signed integer by value (required)
Passes the file number of the file to be updated.
buffer
user-defined structure (required)
Passes the record to be written in the update.
length
16-bit signed integer by value (required)
Passes the number of halfwords or bytes to be written to the file. A positive
value is in halfwords; a negative value is in bytes.
If
length
is less than record size, the length is transferred in halfwords or
bytes and remaining portions of the record will be padded with fill
characters. If
length
equals zero, no transfer occurs and the record
address is overwritten with default fill characters (blanks for ASCII files;
null characters for binary files). If
length
is greater than record size, CCL
is returned and no transfer occurs.
Operation Notes
This intrinsic does not read the advance flag. If the record's key data is unchanged, it does
not position any pointers, but sets the advance flag to TRUE. If the record's key data
changes, it positions the logical record pointer and the physical pointer to the appropriate
record and sets the advance flag to FALSE. The act of updating the keys advances the
pointers to the next record.
The record to be updated is the record pointed to by the logical data pointer. FUPDATE
moves the specified information from the stack into this record. The file containing this
record must be opened with the update
aoption
specified in the FOPEN/HPFOPEN call and
the file cannot have variable-length records. If RIO access is used, the modified record is
set to the ACTIVE state.