Previous Topic: Layout of the IDMS DB Communications BlockNext Topic: Updating Fields in the IDMS DB Communications Block


Fields Containing Program Status Information

The following IDMS DB fields contain program status information:

PROGRAM_NAME

Alphanumeric field that contains the name of the program being executed. The DML precompiler initializes this field automatically, if the program contains an INCLUDE IDMS (SUBSCHEMA_BINDS) statement. If you do not include this statement in your program, you must initialize the field.

ERROR_STATUS

Alphanumeric field that contains a value indicating the outcome of the last DML statement executed. The DML precompiler initializes the ERROR_STATUS field to 1400. The DBMS updates this field after each database service request and before returning control to the program. The DBMS updates this field whether or not the request was processed successfully.

For details on the ERROR_STATUS field and its use, see ERROR_STATUS Field and Codes, later in this chapter.

If your program consists of more than one run unit, it must reinitialize the ERROR_STATUS field to 1400 after finishing one run unit and before binding the next.

DBKEY

Binary fullword field that contains the database key of the last record accessed by the run unit. For Example, after successful execution of a FIND command, the DBMS updates DBKEY with the database key of the located record. If the call to the DBMS results in an error condition, DBKEY remains unchanged.

RECORD_NAME

Alphanumeric field that contains the name of the last record successfully accessed by the run unit. This field is left justified and padded with spaces on the right.

AREA_NAME

Alphanumeric field that contains the name of the last area successfully accessed by the run unit. This field is left justified and padded with spaces on the right.

ERROR_SET

Alphanumeric field that contains the name of the set involved in the last operation that produced an error condition. This field is left justified and padded with spaces on the right.

ERROR_RECORD

Alphanumeric field that contains the name of the record involved in the last operation that produced an error condition. This field is left justified and padded with spaces on the right.

ERROR_AREA

Alphanumeric field that contains the name of the area involved in the last operation that produced an error condition. This field is left justified and padded with spaces on the right.

IDBMSCOM_AREA

Alphanumeric field that is used internally by the DBMS for specification of runtime function information.

PAGE_INFO

Two binary halfwords that represent the page information associated with the last record accessed by the run unit. PAGE_INFO is not changed if the call to the DBMS results in a non-zero status. The first halfword (PAGE_INFO_GROUP) represents the page group number. The second halfword (PAGE_INFO_DBK_FORMAT) represents the db-key radix.

The db-key radix portion of the page information can be used in interpreting a db-key for display purposes and in formatting a db-key from page and line numbers. The db-key radix represents the number of bits within a db-key value that are reserved for the line number of a record. By default, this value is 8, meaning that up to 255 records can be stored on a single page of the area. Given a db-key, you can separate its associated page number by dividing the db-key by 2 raised to the power of the db-key radix. For Example, if the db-key radix is 4, you would divide the db-key value by 2**4. The resulting value is the page number of the db-key. To separate the line number, you would multiply the page number by 2 raised to the power of the db-key radix and subtract this value from the db-key value. The result would be the line number of the db-key. The following two formulas can be used to calculate the page and line numbers from a db-key value:

Page-number = db-key value / (2 ** db-key radix)

Line-number = db-key value - (page-number * ( 2 ** db-key radix))

DIRECT_DBKEY

Binary fullword field that contains either a db-key value that you specify or a null db-key value of -1. This field is used to store records with a location mode of DIRECT. Because the DBMS does not update this field, you must initialize DIRECT_DBKEY. This field can be used only when storing a record in a native VSAM relative record data set (RRDS). You must initialize DIRECT_DBKEY to the relative record number of the record being stored.

DATABASE_STATUS

Alphanumeric field reserved for use by the DBMS.

FILLER

Field used to ensure binary fullword alignment.

RECORD_OCCUR

Binary fullword field that contains a record occurrence sequence identifier used internally by the DBMS.

DML_SEQUENCE

Binary fullword field that contains the source-level sequence number generated by the DML precompiler. The DML precompiler updates this field before each call to the DBMS if you specify DEBUG in the DECLARE SUBSCHEMA statement. The runtime system does not use this field.