Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (W-Z)
Guardian Procedure Calls Reference Manual522629-013
16-8
WRITE[X] Procedures
You should not change the contents of the data buffer between the initiation and
completion of a nowait write operation. This is because a retry can copy the data
again from the user buffer and cause the wrong data to be written. You should
avoid sharing a buffer between a write and another I/O operation because this
creates the possibility of changing the contents of the write buffer before the write
is completed.
Disk File Considerations
Large data transfers for unstructured files using default mode
For the write procedures (WRITE[LOCK] [UNLOCK]), default mode allows I/O
sizes for unstructured files to be as large as 56 KB (57,344), excepting writes to
audited files, if the unstructured buffer size (or block size) is 4 KB (4096). Default
mode here refers to the mode of the file if SETMODE function 141 is not invoked.
For an unstructured file with an unstructured buffer size other than 4 KB, DP2
automatically adjusts the unstructured buffer size to 4 KB, if possible, when an I/O
larger than 4KB is attempted. However, this adjustment is not possible for files that
have extents with an odd number of pages; in such cases an I/O over 4 KB is not
possible. Note that the switch to a different unstructured buffer size will have a
transient performance impact, so it is recommended that the size be initially set to
4 KB, which is the default. Transfer sizes over 4 KB are not supported in default
mode for unstructured access to structured files.
Large data transfers using SETMODE 141
For WRITEX only, large data transfers (more than 4096 bytes) can be done for files
opened with unstructured access, regardless of unstructured buffer size, by using
SETMODE function 141. When SETMODE 141 is used to enable large data
transfers, it is permitted to specify up to 56K (57344) bytes for the
write-count
parameter. Refer to Table 14-4
for use of SETMODE function 141.
File is locked
If a call to WRITE[X] is made and the file is locked through a file number other than
that supplied in the call, the call is rejected with file-system error 73 (file is locked).
Inserting a new record into a file
The WRITE[X] procedure inserts a new record into a file in the position designated
by the file’s primary key:
Key-Sequenced Files The record is inserted in the position indicated by the
value in its primary-key field.
Queue Files The record is inserted into a file at a unique location.
The disk process sets the timestamp field in the key,
which causes the record to be positioned after the
other existing records that have the same high-order
user key.