Reading log records with OPEN, GET, and CLOSE

You can use the assembler language DSNJSLR macro to submit OPEN, GET, and CLOSE functions. Use this stand-alone method to capture log records that you cannot read with the instrumentation facility interface (IFI) when Db2 stops running.

About this task

Begin program-specific programming interface information.Db2 provides the following stand-alone log services that user-written application programs can use to read Db2 recovery log records and control intervals even when Db2 is not running:

  • The OPEN function initializes stand-alone log services.
  • The GET function returns a pointer to the next log record or log record control interval.
  • The CLOSE function deallocates data sets and frees storage.

To invoke these services, use the assembler language DSNJSLR macro and specify one of the preceding functions.

These log services use a request block, which contains a feedback area in which information for all stand-alone log GET calls is returned. The request block is created when a stand-alone log OPEN call is made. The request block must be passed as input to all subsequent stand-alone log calls (GET and CLOSE). The request block is mapped by the DSNDSLRB macro, and the feedback area is mapped by the DSNDSLRF macro.

When you issue an OPEN request, you can indicate whether you want to get log records or log record control intervals. Each GET request returns a single logical record or control interval depending on which you selected with the OPEN request. If neither is specified, the default, RECORD, is used. Db2 reads the log in the forward direction of ascending relative byte addresses or log record sequence numbers (LRSNs).

If a bootstrap data set (BSDS) is allocated before stand-alone services are invoked, appropriate log data sets are allocated dynamically by z/OS®. If the bootstrap data set is not allocated before stand-alone services are invoked, the JCL for your user-written application to read a log must specify and allocate the log data sets to be read.

Important: Use one of the following methods to read active logs while the Db2 subsystem that owns the logs is active:
  • IFCID 0129
  • IFCID 0306
  • Log capture exit

There are no restrictions on reading archive logs.End program-specific programming interface information.