How does one locate and interpret the lock byte on a CA IDMS database page?

Document ID : KB000025909
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction:

When CA IDMS readies a database area, it places a physical lock on a page to disallow update access to that same page from any other job. This document contains instructions on how to how to locate and interpret the lock byte on the page.

Instructions:

         In looking at a database page, the page number of the page is stored in the last 4 bytes of the page. The area lock byte setting is stored in the 2 bytes preceding the page number. The specific value contained in these two bytes will vary depending on where this specific page resides within the page range for the area; the mode in which the area is readied; and on the number of updates which have been performed on this page.

         For the first page in the area, we set the these two bytes to a value of X'0001' whenever the DBMS needs to open an area in update mode; this is referred to as the Area-in-use lock. If the area is not in use by the CV for update (varied offline or readied in retrieval), then this Area-in-use lock is set to X'0000'. For all other pages in the area, these two bytes contain a page update count; i.e. this value is increased by 1 every time that page is updated. If the value eventually reaches X'FFFF', on the next update it is set back to x'0000'.

These bytes are part of the PAGE FOOTER of a database page, which is structured as follows:
 
|Line space | Page Update count | | Line index 0 | count |or Area-in-use-lock | Page number | ---------------------------------------------------------------- 8 bytes 2 bytes 2 bytes 4 bytes

Thus, the 5th byte before the last position on the page is part of a half word (2 bytes) which is used for

1- Page Update Count : for all but the first page of the area, this is a looping counter which is incremented every time a database page is updated;

- or

2- Area-in-use Lock : for the very first page of the area (SMP page), this will indicate whether the area has been readied for update or not.

To summarize, to find and interpret the Area-in-use lock:

1- Go to the first page of the area;

2- Look at the footer of the page.

3- Check the 5th byte before the end of the page. This is the the Area-in-use Lock.

4- When the DBMS readies an area in UPDATE mode, it reads the first page of the area, sets the the Area-in-use Lock to sets it to X'0001', then writes the page back. If the area is not readied by the CV, is varied offline, or is readied for retrieval, this will contain a value of '0000'. 

 

Additional Information:

The CA IDMS Utilities guide contains information about the PRINT PAGE utility statement. This can be used to print the first page on an area so that the Area-In-Lock byte can be viewed and deciphered. 

The CA IDMS System Tasks and Operator Commands reference contains information on the command DCMT DIS MEMORY. This command can be used to display the first page of an area in memory, so that the Area-in-use lock can be viewed and deciphered.