      ****************************************************************
      *                                                              *
      *  THIS AREA IS USED FOR DB2 SQLCODE CHECKING AND FORMATING    *
      *  OF A SYSTEM ERROR IF REQUIRED.                              *
      *                                                              *
      ****************************************************************
           SKIP1
       01  DB2-WORK-FIELDS.
           05  DB2-PARAGRAPH-NBR           PIC X(04).
           05  DB2-SQL-STMT                PIC X(20).
           05  DB2-SQL-KEY                 PIC X(84).
           05  DB2-STATUS-FLAG             PIC X(10)  VALUE '0'.
               88  DB2-STATUS-NULL                    VALUE '0'.
               88  DB2-STATUS-CHECK                   VALUE '1'.
           05  DB2-ERROR-CNTL-FLG          PIC X(01)  VALUE SPACE.
               88  NORMAL-RC                          VALUE ' '.
               88  NORMAL-RC-ONLY                     VALUE 'X'.
               88  DUP-KEY                            VALUE 'D'.
               88  MULTIPLE-ROWS                      VALUE 'M'.
               88  NULL-VALUE                         VALUE 'N'.
               88  OPEN-O-CLOSE-CURSOR                VALUE 'O'.
           05  DB2-SQL-RETURN-CODE         PIC S9(09) COMP VALUE +0.
               88  DB2-NORMAL                         VALUE +0.
               88  DB2-WARNING                        VALUE
                                                      +1 THRU +802.
               88  DB2-RECORD-NOT-FOUND               VALUE +100.
               88  DB2-END-OF-FILE                    VALUE +100.
               88  DB2-RESOURCE-UNAVAILABLE           VALUE -904.
               88  DB2-DEAD-LOCK-ROLLBACK             VALUE -911.
               88  DB2-TIME-OUT-ROLLBACK              VALUE -911.
               88  DB2-DEAD-LOCK                      VALUE -913.
               88  DB2-TIME-OUT                       VALUE -913.
               88  DB2-FATAL-ERROR                    VALUE
                                                      -927 THRU -1.
               88  DB2-MULTIPLE-ROWS                  VALUE -811.
               88  DB2-DUPLICATE-KEY                  VALUE -803.
               88  DB2-NULL-VALUE-RETURN              VALUE -305.
               88  DB2-SUBSYSTEM-ERROR                VALUE -805,
                                                      -927 THRU -817.
           05  DB2-MESSAGE-AREA.
               10  DB2-MSG-TEXT                PIC  X(34) VALUE
                 'SYSTEM ERR - CALL MIS - SQLCODE = '.
               10  DB2-MSG-SQLCODE             PIC -9(03).
               10  FILLER                      PIC  X(01) VALUE SPACE.
               10  FILLER                      PIC  X(07) VALUE
                 'PARA = '.
               10  DB2-MSG-PARA-NBR            PIC  X(04).
               10  FILLER                      PIC  X(07) VALUE
                 ' ERRMC='.
               10  DB2-MESSAGE-SQLERRMC        PIC  X(70).
           05  CICS-MESSAGE-AREA.
               10  CICS-MSG-TEXT                PIC  X(31) VALUE
                 'SYSTEM ERR - CALL MIS - CODE = '.
               10  CICS-MSG                     PIC  X(48).

           05  CICS-FATAL-MESSAGE-AREA.
               10  FILLER              PIC  X(80) VALUE ALL ' '.
               10  FILLER              PIC  X(80) VALUE ALL '='.
               10  FILLER              PIC  X(80) VALUE
                 '     (LTS/MTS/PTS/FDAT) - CICS/DB2 ERROR MESSAGE'.
               10  FILLER              PIC  X(80) VALUE
                 '     SYSTEM ERROR - CALL MIS SUPPORT !!!        '.
               10  FILLER              PIC  X(80) VALUE ALL '='.
               10  FILLER              PIC  X(10) VALUE
                 'TRAN ID  ='.
               10  CICS-FATAL-TRAN-ID  PIC  X(70).
               10  FILLER              PIC  X(10) VALUE
                 'PROGRAM  ='.
               10  CICS-FATAL-PROGRAM  PIC  X(70).
               10  FILLER              PIC  X(10) VALUE
                 'SQLCODE  ='.
               10  CICS-FATAL-SQLCODE  PIC -9(03).
               10  FILLER              PIC  X(66) VALUE SPACE.
               10  FILLER              PIC  X(10) VALUE
                 'PARAGRAPH='.
               10  CICS-FATAL-PARA-NBR PIC  X(70).
               10  FILLER              PIC  X(10) VALUE
                 'SQLERRMC ='.
               10  CICS-FATAL-SQLERRMC PIC  X(70).
               10  FILLER              PIC  X(10) VALUE
                 'DFHEIBLK ='.
               10  CICS-FATAL-MESSAGE.
                   15  CFM-EIBERR      PIC X(01).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBERRCD    PIC X(04).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBFN       PIC X(02).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBRCODE    PIC X(06).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBRSRCE    PIC X(08).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBTRMID    PIC X(04).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBTRNID    PIC X(04).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBDATE     PIC 9(07).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBTIME     PIC 9(07).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBRESP     PIC X(02).
                   15  FILLER          PIC X(02).
                   15  CFM-EIBMSG-OUT  PIC X(50).
                   15  FILLER          PIC X(35).
               10  FILLER              PIC  X(80) VALUE ALL '='.
           05  CICS-EIB-X              PIC S9(04) COMP.
           05  CICS-EIBRESP            PIC  X(02).
