Reading specific log records (IFCID 0129)
You can use IFCID 129 with an IFI READS (read synchronously) request to return a specific range of log records from the active log into the return area that is initialized by your program.
About this task
Enter
the following command into your IFI program:
CALL DSNWLI(READS,ifca,return_area,ifcid_area,qual_area)IFCID 129 must appear in the IFCID area.
To retrieve the log control interval, your program must initialize certain fields in the qualification area:
- WQALLTYP
- This is a 3-byte field in which you must specify CI (with a trailing
blank), which stands for
control interval
. - WQALLMOD
- In this 1-byte field, you specify whether you want the first log
CI of the restarted Db2 subsystem,
or whether you want a specific control interval as specified by the
value in the RBA field.
- F
- The
first
option is used to retrieve the first log CI of this Db2 instance. This option ignores any value in WQALLRBA and WQALLNUM. - P
- The
partial
option is used to retrieve partial log CIs for the log capture exit routine. Db2 places a value in field IFCAHLRS of the IFI communication area, as follows:- The RBA of the log CI given to the log capture exit routine, if the last CI written to the log was not full.
- 0, if the last CI written to the log was full.
When you specify option P, Db2 ignores values in WQALLRBA and WQALLNUM.
- R
- The
read
option is used to retrieve a set of up to 7 continuous log CIs. If you choose this option, you must also specify the WQALLRBA and WQALLNUM options, which the following text details.
- WQALLRBA
- In this 8-byte field, you specify the starting log RBA of the
control intervals to be returned. This value must end in X'000' to
put the address on a valid boundary. This field is ignored when using
the WQALLMOD=F option.
If you specify an RBA that is not in the active log, reason code 00E60854 is returned in the field IFCARC2, and the RBA of the first CI of the active log is returned in field IFCAFCI of the IFCA. These 6 bytes contain the IFCAFCI field.
- WQALLNUM
- In this 2-byte field, specify the number of control intervals you want returned. The valid range is from X'0001' through X'0007', which means that you can request and receive up to seven 4-KB log control intervals. This field is ignored when using the WQALLMOD=F option.
If you specify a range of log CIs, but some of those records have not yet been written to the active log, Db2 returns as many log records as possible. You can find the number of CIs returned in field QWT02R1N of the self-defining section of the record.