The WRITE JOURNAL statement writes a task-defined record to the journal file. Records written to the journal file with the WRITE JOURNAL function will be available to user-defined exit routines during a task- or system-initiated rollback.
►►─── WRITE JOURNAL ─┬────────────┬─┬──────────┬──────────────────────────────► ├─ WAIT ─────┤ ├─ SPAN ◄ ─┤ └─ NOWAIT ◄ ─┘ └─ NOSPAN ─┘ ►─── FROM (record-location) ─┬─ TO (end-record-location) ─┬─ ; ──────────────►◄ └─ LENGTH (record-length) ───┘
Specifies whether the issuing task is to wait for completion of the WRITE JOURNAL function before resuming execution:
Specifies that the issuing task will wait for completion of the physical I/O associated with the WRITE JOURNAL function before resuming execution. This option will cause the system to write a partially filled buffer to the journal file.
Specifies that the issuing task will not wait for completion of the WRITE JOURNAL function; the journal record will remain in a storage buffer until a future request necessitates writing the buffer to the journal file. NOWAIT is the default.
Indicates that the system will write the record across several journal file blocks, if necessary. SPAN is the default.
Note: In general, the SPAN option provides better space utilization in the journal file than NOSPAN because it increases the average fullness of each block.
Indicates that the system will write the record to a single journal file block; if it is longer than the journal block, the record will be split.
When a record is shorter than a journal file block, based on space available in the current journal block, the system will either place the record in the block, split it across multiple blocks (SPAN), or write it to a new block after the current block is written (NOSPAN).
The following considerations apply to using an exit routine to retrieve journal file records during recovery:
Defines the program variable-storage entry of the record to be written to the journal file. Record-location is the symbolic name of a user-defined field. The length of the record area is determined by one of the following specifications:
Indicates the end of the record area to be written to the journal file and is specified following the last data-item entry in record-location. End-record-location is the symbolic name of either a user-defined dummy byte field or a field that contains a data item not associated with the record being written to the journal file.
Defines the length, in bytes, of the record to be written to the journal file. Record-length is either the symbolic name of the user-defined field that contains the length, or the length itself expressed as a numeric constant.
The following statement writes the JOURNAL_DATA record to the journal file, spanning it across several blocks if necessary:
WRITE JOURNAL SPAN FROM (JOURNAL_DATA) TO (END_JOURNAL_DATA);
Upon completion of the WRITE JOURNAL function, the ERROR_STATUS field in the IDMS DC communications block indicates the outcome of the operation:
The request has been serviced successfully.
Storage is not available for the required control blocks.
The derived length of the specified journal record is zero or negative.
An invalid status has been received from DBIO/DBMS; check the system log for details.
|
Copyright © 2014 CA.
All rights reserved.
|
|