Log analysis (database related)
The IMS log is one of the most useful of all IMS service aids. Understanding log records and what information they contain can be very beneficial.
Log record analysis
For all changes, write a copy of the segment before it is changed as well as a copy of the segment after it is changed, if applicable. This process not only facilitates backout and recovery, but it also is useful for diagnosis.
Analyzing log records is helpful whenever you suspect bad data or a pointer problem. Determine where the error is by referring to error messages or to the contents of the dump. When you identify the location of the problem, use the File Select and Formatting utility (DFSERA10) to print the log records for the block in error. Refer to the following table to interpret the contents of the log records. You can determine what changes to the data have been made, and in what sequence the changes were made. This information is helpful in identifying the source of the error.
Sometimes, the error is caused by an internal IMS problem; other times, the error results from incorrect data that is entered by a user or by an application.
To obtain a complete listing of all control blocks, DB, DC, and log records, assemble module DFSADSCT.
CICS® puts a header on log records. To obtain the log records when running with CICS, the DD statement pointing to the CICS journal must specify DCB=RECFM=VB. This allows the File Select and Formatting utility to remove the header.
Example of log analysis
An abend is issued against a database. You have used other diagnostic tools to analyze the call. Now you must look at the database. Follow these steps when looking at the database:
- Analyze the buffer to identify what seems to be wrong. (See the following figure.) The first indication that something is wrong is usually found in the buffer.
- Look at the changes to that buffer (block) on the log.
- Determine if the bad data is actually on the database.
- If required, determine if the image copy is propagating the bad block.
The following figure shows the general areas of database analysis: Application, Buffer, Database, Image Copy, and Log.

Database change log record DSECT
You can use the following table to assist you in the analysis of output from log record type X'50'.
If any differences are detected in the mapping of the DSECT, you can obtain a current copy by assembling the macro ILOGREC.
Offset | Field | Length | Description |
---|---|---|---|
DLOGB |
DSECT | ||
00 |
DLENGTH |
2 |
Length of log record |
02 |
DLOGZZ |
2 |
Zeros for QSAM |
04 |
DLOGCODE |
1 |
Log record type |
05 |
DLOGSCDE |
1 |
Log record subrecord (X'50' X'51' X'52') |
06 |
DLOGPSTN |
2 |
PST number |
08 |
DLOGRTKN |
16 |
Recovery token |
18 |
DLOGSTCK |
8 |
CPU store clock (STCK) |
20 |
DLOGVIMS |
1 |
DLOG IMS Version/Release: |
28 |
DLOGDBF1 |
1 |
Flag 1 |
29 |
DLOGDBF2 |
1 |
Flag 2 |
2A |
DLOGDBOR |
1 |
Database organization |
2B |
DLOGDSOR |
1 |
Data set organization |
2C |
DPGMNAME |
8 |
PSB name |
34 |
DDBDNAME |
8 |
Database name |
3C |
DDSID |
1 |
Data set ID (DCB number) X'80'
|
3D | DDSID2 | 1 | For ARID |
3E |
DLOGSLVL |
1 |
Database share level (for DBRC-registered databases) |
3F | DLOGCALL | 1 | Describe DL/I call issued by application program X'80' ISRT call X'40' REPL call X'20' DLET call X'10' ROLL/ROLB/ROLS call (backout) |
40 |
DLOGRBA |
4 |
OSAM RBN or VSAM RBA (LRECL) |
44 |
DLOGBLK0 |
2 |
Offset of RBA within block |
48 | DLOGSEQ | 4 | Update the sequence number when X'04' flag is on in DLOGDBF2 |
4C |
DLOGXTOF |
2 |
Database extension section offset (not used)1 |
4E |
DLOGDSOF |
2 |
Data sharing section offset1 |
50 |
DLOGIDOF |
2 |
RACF® userid offset1 |
52 |
DLOGTKOF |
2 |
Tracking (XRF) section offset1 |
54 |
DLOGDLOF |
2 |
DL/I call section offset (not used)1 |
56 |
DLOGKYOF |
2 |
Key data section offset1 |
58 |
DLOGSPOF |
2 |
Space management section offset1 |
5A |
DLOGUNOF |
2 |
UNDO data offset1 |
5C |
DLOGREOF |
2 |
REDO data offset1 |
60 |
DDATE | 4 | Date in the format YYYYDDDF |
64 |
DTIME | 6 | Time in the format HHMMSSTHMIJU |
6A | DZONE | 2 | Offset to local time |
Data sharing section (DLOGDSHUR DSECT) |
|||
00 |
DLOGDSSN |
4 |
Data set sequence number (DSSN) |
04 |
DLOGLSN |
6 |
Lock sequence number (LSN) |
0A | DLOGUSID | 4 | Update Set ID (USID) |
RACF/SIGNON userid (DLOGID DSECT) |
|||
00 |
DLOGUSER |
8 |
RACF userid |
Buffer and lock tracking for DL/I in XRF-capable systems (DLOGTRCK DSECT) |
|||
00 |
DLOGPOOL |
2 |
Pool size for buffer tracking |
02 |
DLOGBUFF |
2 |
Buffer number for buffer tracking |
04 |
DLOGHASH |
4 |
Root hash value |
08 | DLOGLOCK | 4 | Lock value |
0C |
DLOGLFL1 |
1 |
Change logger lock flag |
0D | DLOGLFL2 | 1 | Reserved |
0E | DLOGDBDN | 8 | DBD name |
16 | DLOGSKID | 4 | Task ID |
KSDS key data section (DLOGKEY DSECT) |
|||
00 |
DLOGKYF1 |
1 |
|
02 |
DLOGKLEN |
2 |
Length of key |
04 |
DLOGKDAT |
variable |
Key data |
Space management section for HD inserts and deletes (DLOGSPCE DSECT) |
|||
00 |
DLOGSPF1 |
1 |
Space management flags |
02 |
DLOGSOFF |
2 |
Offset of space management request |
04 |
DLOGSLEN |
2 |
Length of space management request |
UNDO/REDO data section (DLOGDATA DSECT) |
|||
00 |
DLOGDFLG |
1 |
|
01 |
DLOGDFUN |
1 |
Describe physical function being logged by this request X'80' Physical insert |
02 |
DLOGDOFF |
2 |
Offset of data in buffer |
04 |
DLOGDLEN |
2 |
Length of data (DLOGDDAT) |
06 |
DLOGDDAT |
variable |
Variable length data |
00 |
|
Compressed data format in DLOGDDAT |
|
DBCKCHN |
6 |
Back chain2 |
|
DBLGSEG |
8 |
Logical logger sequence number2 |
|
Notes:
|