Guardian Procedure Calls Reference Manual
Disk File Considerations
• Large data transfers
For WRITEUPDATEX only, large data transfers (more than 4096 bytes), can be enabled by
using SETMODE function 141. See Table 44 (page 1319).
• Random processing and WRITEUPDATE[X]
For key-sequenced, relative, and entry-sequenced files, random processing implies that a
designated record must exist. This means that positioning for WRITEUPDATE[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 WRITEUPDATE[X] is rejected with file-system error 11 (record
does not exist).
• File is locked
If a call to WRITEUPDATE[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).
• When the just-read record is updated
A call to WRITEUPDATE[X] following a call to READ[X], without intermediate positioning,
updates the record just read.
• Unstructured files
Unstructured disk file: transferring data
If the WRITEUPDATE[X] is to an unstructured disk file, data is transferred to the record
location specified by the current-record pointer.
◦
◦ File pointers after a successful WRITEUPDATE[X]
After a successful WRITEUPDATE[X] to an unstructured file, the current-record and
next-record pointers are unchanged.
◦ The number of bytes written
If the unstructured file is created with the odd unstructured attribute (also known as
ODDUNSTR) set, the number of bytes written is exactly the number specified in
write-count. If the odd unstructured attribute is not set when the file is created, the
value of write-count is rounded up to an even value before the WRITEUPDATE[X] is
executed.
You set the odd unstructured attribute with the FILE_CREATE_, FILE_CREATELIST_, or
CREATE procedure, or with the File Utility Program (FUP) SET and CREATE commands.
• Structured files
Calling WRITEUPDATE[X] after KEYPOSITION
If the call to WRITEUPDATE[X] immediately follows a call to KEYPOSITION in which a
nonunique alternate key is specified as the access path, the WRITEUPDATE[X] fails. A
◦
subsequent call to FILE_GETINFO_ or FILEINFO shows that error 46 (invalid key) occurred.
However, if an intermediate call to READ[X] or READLOCK[X] is performed, the call to
WRITEUPDATE[X] is permitted because a unique record is identified.
◦ Specifying write-count for entry-sequenced files
For entry-sequenced files, the value of write-count must match exactly the
write-count value specified when the record was originally inserted into the file.
WRITEUPDATE[X] Procedures 1513