REWRITE request processing
The REWRITE request is used to write a record back to a file following a READ UPDATE request.
VSAM processing
- The RPL is set to point to the user-specified data area. If the user specified a record that is too large for the file, the length in the RPL is set to the maximum length, so that the record is truncated.
- The RPL is completed.
- If there is a CICS®-maintained shared data table
associated with the base cluster:
- If the file is unrecoverable, a record lock is obtained. (If the file is recoverable, a lock is already held).
- A data table request is issued to invalidate the record in the table before the VSAM update.
- VSAM is called to PUT(UPDATE) the record. Exclusive control of the CI, which was obtained for the preceding READ UPDATE request, is released, but the CICS record lock (for recoverable files) is retained until the next sync point, in case the transaction abends and dynamic transaction backout processing is necessary.
- If there is a data table associated with the data set, the table record is updated and its validity is reinstated, by issuing a call to data table services. If the file is unrecoverable, the record lock is released.
- If the file is recoverable, and if the record is successfully rewritten, the after-image is written to the log for forward recovery.
- The VSWA for the operation is released. Note: When a record is updated by way of a path, the corresponding alternate index is updated by VSAM to reflect the change. However, if the record is updated directly by way of the base, or by a different path, the alternate index is only updated by VSAM if it has been defined to VSAM (when created) to belong to the upgrade set of the base data set.
BDAM processing
- The FIOA that was used in the corresponding READ UPDATE request is located, and the modified record read into it from the user-specified area. If the record is too long, it is truncated.
- A FREEMAIN call is issued to release the FWA.
- If the file is recoverable, the request is logged. If required, the request is also recorded in a user-specified journal.
- The key field is converted from character string format to binary format, if necessary, and the BDAM I/O request issued.
- The key returned by BDAM is converted from binary format to character string format, if necessary, and passed to the application.
- A supervisor call (SVC 53) is issued to release BDAM exclusive control, if necessary.
- A FREEMAIN call is issued to release the FIOA.