Previous Topic: The ALLOWING ClauseNext Topic: ADSO-STAT-DEF-REC


Status Definition Records

Overview

Status codes can be tested using a system-supplied status definition record or by using a site-defined definition record. A status definition record associates status codes with level-88 condition names. The condition names can be coded in error expressions in place of 4-character status codes.

The status definition record is specified by the STATUS clause of the system generation ADSO statement. The STATUS clause specifies:

Note: For more information about the system generation ADSO statement, see the CA IDMS System Generation Guide.

A status definition record is associated with a dialog during dialog compilation. However, a buffer for this record is not allocated at runtime.

System-Supplied Status Definition Record

CA ADS supplies the ADSO-STAT-DEF-REC status definition record. ADSO-STAT-DEF-REC defines level-88 record elements for the status codes most commonly tested.

Tests that specify error-status code names can include only those condition names that are defined in the status definition record associated with the dialog.

Example 1: Testing with the 4-byte status code

The following example tests for an error using the 4-byte status code 0307:

IF ERROR-STATUS IS '0307'
THEN
    CALL SUBA.
ELSE
    CALL SUBZ.

Example 2: Testing with a status definition record

The following example uses a status definition record level-88 element to test for the same error as in example 1 above:

IF DB-END-OF-SET
THEN
    CALL SUBA.
ELSE
    CALL SUBZ.
OBTAIN CALC DEPARTMENT.
OBTAIN CALC OFFICE.
IF DB-REC-NOT-FOUND FOR DEPARTMENT
  THEN CALL SUBA.
IF DB-REC-NOT-FOUND FOR OFFICE
  THEN CALL SUBB.

Site-Defined Status Definition Record

The system-defined status definition record ADSO-STAT-DEF-REC can be modified or replaced with one or more site-specific status definition records by using the IDD DDDL compiler.

Considerations

Example 1: Defining a site-specific status definition record

In this example, the first record defines the field CODE-FIELD, which contains two level-88 condition names. The second record contains only level-88 record elements. Record definitions are shown below:

01   ADSO-ONE-STAT-REC
     02   CODE-FIELD               PIC X(4).
          88   OKAY                VALUE '0000'.
          88   NOT-SO-GOOD         VALUE '0001' THRU '9999'.
01   ADSO-TWO-STAT-DEF
     88   DB-STATUS-OKAY           VALUE '0000'.
     88   DB-END-OF-SET            VALUE '0307'.
     88   NO-RECORD                VALUE '0326'.
     88   MODIFY-PROBLEM           VALUE '0800' THRU '0899'.

Example 2: Testing for the return of specific error codes

In this example, ADSO-TWO-STAT-DEF (defined in example 1) is used to test for the return of error-status codes 0800 through 0899:

MODIFY CUST
IF MODIFY-PROBLEM
THEN
    .
    .
    .

Example 3: Testing for subschema record error status

In this example, ADSO-ONE-STAT-REC (defined in example 1) is used to test the latest error status returned for subschema records DEPARTMENT and OFFICE:

OBTAIN CALC DEPARTMENT.
OBTAIN CALC OFFICE.
IF NOT-SO-GOOD FOR DEPARTMENT
  THEN CALL SUBA.
IF NOT-SO-GOOD FOR OFFICE
  THEN CALL SUBB.

Note: For more information about using the RECORD statement to add, modify, or delete status definition records, see the CA IDMS IDD Quick Reference Guide.

More information:

CA ADS Dialog Compiler (ADSC)