Guardian Procedure Calls Reference Manual (G06.25+)

Guardian Procedure Calls (W-Z)
Guardian Procedure Calls Reference Manual522629-013
16-37
WRITEUPDATEUNLOCK[X] Procedures
Considerations
WRITEUPDATEUNLOCK versus WRITEUPDATEUNLOCKX
Use WRITEUPDATEUNLOCK when the buffer has a 16-bit address, and use
WRITEUPDATEUNLOCKX when the buffer has a 32-bit extended address.
Therefore, the data buffer for WRITEUPDATEUNLOCKX can be either in the
caller’s stack segment or any extended data segment.
Nowait I/O and WRITEUPDATEUNLOCK[X]
The WRITEUPDATEUNLOCK[X] procedure must complete with a corresponding
call to the AWAITIO[X] procedure when used with a file that is opened nowait. If
WRITEUPDATEUNLOCKX is used, you must call AWAITIOX to complete the I/O.
If WRITEUPDATEUNLOCK is used, you can use either AWAITIO or AWAITIOX to
complete the I/O.
For files audited by the Transaction Management Facility (TMF), AWAITIO[X] must
be called to complete the WRITEUPDATEUNLOCK[X] operation before
ENDTRANSACTION or ABORTTRANSACTION is called.
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.
Random processing and WRITEUPDATEUNLOCK[X]
For key-sequenced, relative, and entry-sequenced files, random processing
implies that a designated record must exist. This means positioning for
WRITEUPDATEUNLOCK[X] is always to the record described by the exact value
of the current key and current-key specifier. If such a record does not exist, the
call to WRITEUPDATEUNLOCK[X] is rejected with file-system error 11 (record
does not exist).
Unstructured files—pointers unchanged
For unstructured files, data is written in the position indicated by the current-record
pointer. A call to WRITEUPDATEUNLOCK[X] for an unstructured file typically
follows a call to POSITION or READUPDATE[X]. The current-record and next-
record pointers are not changed by a call to WRITEUPDATEUNLOCK[X].
How WRITEUPDATEUNLOCK[X] works
The record unlocking performed by WRITEUPDATEUNLOCK[X] functions in the
same manner as UNLOCKREC.
Record does not exist
Positioning for WRITEUPDATEUNLOCK[X] is always to the record described by
the exact value of the current key and current-key specifier. Therefore, if such a