CEE3CIB—Return pointer to condition information block

CEE3CIB returns a pointer to a condition information block (CIB) associated with a given condition token. Use this service only during condition handling.

For PL/I and COBOL applications, Language Environment provides called header, COPY, or include files (in SCEESAMP) that map the CIB. For C/C++ applications, the macros are in the header file leawi.h (in SCEEH.H).

The CIB contains detailed information about the condition and provides input to your application's condition handlers, which can then respond more effectively to a given condition.

Read syntax diagramSkip visual syntax diagram
Syntax

>>-CEE3CIB--(--+------------+--,--cib_ptr--,--fc--)------------><
               '-cond_token-'                         

cond_token
The condition token passed to a user-written condition handler. If you do not specify this parameter, Language Environment returns the address of the most recently-raised condition.
cib_ptr
The address of the CIB associated with the condition token.
fc (output)
A 12-byte feedback code, optional in some languages, that indicates the result of this service. If you choose to omit this parameter, refer to Invoking callable services for the appropriate syntax to indicate that the feedback code was omitted.

The following symbolic conditions can result from this service:

Code Severity Message number Message text
CEE000 0 The service completed successfully.
CEE35S 1 3260 No condition was active when a call to a condition management routine was made.
CEE35U 1 3262 An invalid condition token was passed. The condition token did not represent an active condition.

Usage notes

  • Because the CIB is used only for synchronous signals, you should not use CEE3CIB in signal catchers that are driven for asynchronous signals.
  • After the condition handling functions return control to your application, cib_ptr is no longer valid.
  • z/OS UNIX consideration—In multithread applications, CEE3CIB returns the CIB associated with the current token on only the current thread.

For more information

Examples

  1. Following is example of CEE3CIB called by C/C++.
    /*Module/File Name: EDC3CIB   */
    
    #include <stdio.h>
    #include <leawi.h>
    #include <stdlib.h>
    #include <string.h>
    #include <ceeedcct.h>
    
    #ifdef __cplusplus
       extern "C" {
    #endif
       void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *);
    #ifdef __cplusplus
       }
    #endif
    
    int main(void) {
    
      _FEEDBACK fc;
      _ENTRY routine;
      _INT4 token;
      int x,y,z;
    
      /* set the routine structure to point to the handler */
      /* and use CEEHDLR to register the user handler      */
    
      token = 99;
      routine.address = (_POINTER)&handler;;
      routine.nesting = NULL;
    
      CEEHDLR(&routine,&token,&fc);
      /* verify that CEEHDLR was successful */
      if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
        printf("CEEHDLR failed with message number %d\n",
               fc.tok_msgno);
        exit(2999);
      }
      x = 5;
      y = 0;
      z = x / y;
    }
    
    /*******************************************************/
    /* handler is a user condition handler                 */
    /*******************************************************/
    void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result,
                 _FEEDBACK *newfc) {
    
       _CEECIB *cib_ptr;
       _FEEDBACK cibfc;
    
       CEE3CIB(fc, &cib_ptr, &cibfc);
    
      /* verify that CEE3CIB was successful */
      if ( _FBCHECK ( cibfc , CEE000 ) != 0 ) {
        printf("CEE3CIB failed with message number %d\n",
               cibfc.tok_msgno);
        exit(2999);
      }
    
       printf("%s \n",(*cib_ptr).cib_eye);
       printf("%d \n",cib_ptr->cib_cond.tok_msgno);
       printf("%s \n",cib_ptr->cib_cond.tok_facid);
       *result = 10;
    }
  2. Following is an example of CEE3CIB called by COBOL.
    CBL LIB,QUOTE
          *Module/File Name: IGZT3CIB
          ************************************************
          **                                            **
          ** CBL3CIB - Register a condition handler     **
          **           that will call CEE3CIB to get    **
          **           a Condition Information Block    **
          **           (CIB) for the condition.         **
          **                                            **
          ************************************************
           IDENTIFICATION DIVISION.
           PROGRAM-ID. CBL3CIB.
    
           DATA DIVISION.
           WORKING-STORAGE SECTION.
           01  ROUTINE  PROCEDURE-POINTER.
           01  TOKEN                   PIC S9(9) BINARY.
           01  FC                      PIC X(12).
           PROCEDURE DIVISION.
           PARA-CBL3CIB.
               SET ROUTINE TO ENTRY "HANDLER".
               CALL "CEEHDLR" USING ROUTINE, TOKEN, FC.
    
               GOBACK.
           END PROGRAM CBL3CIB.
    
       CBL LIB,QUOTE
           IDENTIFICATION DIVISION.
           PROGRAM-ID. HANDLER.
           DATA DIVISION.
           WORKING-STORAGE SECTION.
           01  CIB-PTR POINTER.
           01  FC                      PIC S9(9) BINARY.
           LINKAGE SECTION.
          *************************************************
          ** Include the mapping of the CIB              **
          *************************************************
           COPY CEEIGZCI.
           01  CURCOND                 PIC X(12).
           01  TOKEN                   PIC S9(9) BINARY.
           01  RESULT                  PIC S9(9) BINARY.
           01  NEWCOND                 PIC X(12).
           PROCEDURE DIVISION USING CURCOND, TOKEN,
                                    RESULT, NEWCOND.
           PARA-HANDLER.
               CALL "CEE3CIB" USING CURCOND, CIB-PTR, FC.
               SET ADDRESS OF CEECIB TO CIB-PTR.
               DISPLAY "In Handler".
               DISPLAY CIB-EYE.
               DISPLAY CIB-TOK-MSGNO.
               DISPLAY CIB-TOK-FACID.
    
               GOBACK.
           END PROGRAM HANDLER.
  3. Following is an example of CEE3CIB called by PL/I.
    *PROCESS OPT(0), MACRO;
     /* Module/File Name: IBM3CIB                        */
     /****************************************************/
     /**                                                **/
     /** Function: CEE3CIB - example of CEE3CIB         **/
     /**                     invoked from PL/I ON-unit  **/
     /**                                                **/
     /****************************************************/
    
     IBM3CIB:  PROCEDURE  OPTIONS(MAIN);
    
       %INCLUDE CEEIBMAW;
       %INCLUDE CEEIBMCT;
       %INCLUDE CEEIBMCI;
    
       DECLARE
          CIB_PTR     POINTER,
          01 FC,                       /* Feedback token */
             03 MsgSev    REAL FIXED BINARY(15,0),
             03 MsgNo     REAL FIXED BINARY(15,0),
             03 Flags,
                05 Case      BIT(2),
                05 Severity  BIT(3),
                05 Control   BIT(3),
             03 FacID     CHAR(3),        /* Facility ID */
             03 ISI     /* Instance-Specific Information */
                     REAL FIXED BINARY(31,0),
          divisor     FIXED BINARY(31) INITIAL(0);
    
       ON  ZERODIVIDE  BEGIN;
    
          CALL CEE3CIB(*, CIB_PTR, FC);
          IF  FBCHECK( FC, CEE000 )  THEN  DO;
             PUT SKIP LIST('Found ' || CIB_PTR->CIB_EYE ||
                ' for message #' || CIB_PTR->CIB_TOK_MSGNO
                || ' from ' || CIB_PTR->CIB_TOK_FACID );
             END;
          ELSE  DO;
             DISPLAY( 'CEE3CIB failed with msg '
                || FC.MsgNo );
             END;
    
          END /* ON ZeroDivide */;
    
       divisor = 15 / divisor  /* signals ZERODIVIDE */;
    
     END IBM3CIB;