What is the message data block (MDB)

The MDB is a data area that contains either a message or a DOM directed to an extended MCS console, and any information related to that message. It also contains a prefix area mapped by mapping macro IEAVG132. This area points to any subsequent MDBs for a given message. If there are no subsequent MDBs, this area contains a zero.

Messages reside in MDBs, which are put into a data space created when a program issues the MCSOPER macro to establish itself as an extended MCS console. When a message is sent to an extended MCS console, the system places the message in an MDB, where the message stays until the extended MCS console program issues the MCSOPMSG macro to locate the message.

If a DOM is directed to a previously issued message, the system creates a separate MDB for the DOM. The MDBGDOM field in the MDB identifies the MDB as a DOM MDB. The MDBDOMFL field indicates whether the console specified DOM(NORMAL) or DOM(ALL). If the console specified DOM(NORMAL), MDBGMID in the DOM MDB matches the same field in the message MDB. If the console specified DOM(ALL), the DOM field values in the control program object indicate which message or messages this DOM is to delete. A single DOM MDB can delete more than one message.

Figure 1 illustrates the structure of an MDB for a message that requires more than one MDB.
Figure 1. MDB Structure
ieaa8mdb

The MDB generally contains three objects, each beginning with the length and MDB type specific to each object. To locate the objects, use the address of the MDB returned by MCSOPMSG. The object type identifies the object as a general, control, or text object. Within each object is a field that contains the length of the particular object. MDBGLEN contains the length of the general object, MDBCLEN contains the length of the control program object, and MDBTLEN contains the length of the text object.

To find the first object, add the length of the header to the MDB address. The object type will tell you whether it is a general, control, or text object. To find the end of the first object, add the length of that object to the end of the header.

You can find subsequent objects by identifying the end of the previous object, and adding the length of the next one. Compare the end value to the end of the MDB length to ensure that you are still looking within the MDB.

You can find the end of the MDB by adding the total length of the MDB, which is contained in the first field of the header, to the address of the MDB.

The three MDB objects are:

The general objects and the control program objects appear anywhere in the first MDB, but text objects are sorted in order within and among MDBs.

If the system sends a DOM to an extended MCS console, the MDB contains only two objects: the general object and the control program object.