Guardian Procedure Calls Reference Manual
If the file is audited, the record is available for read operations when the
transaction associated with the write operation commits. If the transaction aborts,
the record is never available to read operations.
If the file is not audited, the record is available as soon as the write operation
finishes successfully.
Unlike other key-sequenced files, a write operation to a queue file will never
encounters an error 10 (duplicate record) because all queue file records have
unique keys generated for them.
After an open or an explicit positioning by its primary key, the record is inserted
in the designated position. Subsequent WRITE[X]s without intermediate
Relative Files
positioning insert records in successive record positions. If -2D is specified in
a preceding positioning, the record is inserted in an available record position
in the file.
If -1D is specified in a preceding positioning, the record is inserted following
the last position used in the file. There does not have to be an existing record
in that position at the time of the WRITE[X].
NOTE: If the insert is to be made to a key-sequenced or relative file and the
record already exists, the WRITE[X] fails, and a subsequent call to
FILE_GETINFO_ or FILEINFO shows that error 10 occurred.
The record is inserted following the last record currently existing in the file.Entry-Sequenced Files
The record is inserted at the position indicated by the current value of the
next-record pointer.
Unstructured Files
• Structured files
Inserting records into relative and entry-sequenced files
If the insertion is to a relative or entry-sequenced file, the file must be positioned currently
through its primary key. Otherwise, the WRITE[X] fails, and a subsequent call to
FILE_GETINFO_ or FILEINFO shows that error 46 (invalid key) occurred.
◦
◦ Current-state indicators after WRITE[X]
After a successful WRITE[X], the current-state indicators for positioning mode and
comparison length remain unchanged.
For key-sequenced files, the current position and the current primary-key value remain
unchanged.
For relative and entry-sequenced files, the current position is that of the record just inserted
and the current primary-key value is set to the value of the record's primary key.
◦ Duplicate record found on insertion request
When attempting to insert a record into a key-sequenced file, if a duplicate record is
found, the WRITE[X] procedure returns error 10 (record already exists) or error 71
(duplicate record). If the operation is part of a TMF transaction, the record is locked for
the duration of the transaction.
• Unstructured files
DP2 BUFFERSIZE rules
DP2 unstructured files are transparently blocked using one of the four valid DP2 blocksizes
(512, 1024, 2048, or 4096 bytes; 4096 is the default). This transparent blocksize,
◦
known as BUFFERSIZE, is the transfer size used against an unstructured file. While
BUFFERSIZE does not change the maximum unstructured transfer (4096 bytes), multiple
I/Os may be performed to satisfy a user request depending on the BUFFERSIZE chosen.
For example, if BUFFERSIZE is 512 bytes, and a request is made to write 4096 bytes, at
least eight transfers, each 512 bytes long, will be made. More than eight transfers happen,
in this case, if the requested transfer does not start on a BUFFERSIZE boundary.
1494 Guardian Procedure Calls (W-Z)