CEEDCOD—Decompose a condition token

CEEDCOD alters an existing condition token. Language Environment-conforming HLLs can decompose or alter the condition token fields without using the CEEDCOD service. See the CEESGL HLL examples in Examples for examples of how to alter the condition token field.
Read syntax diagramSkip visual syntax diagram
Syntax

>>-CEEDCOD--(--cond_token--,--c_1--,--c_2--,--case--,----------->

>--severity--,--control--,--facility_ID--,--i_s_info--,--fc----->

>--)-----------------------------------------------------------><

cond_token (input)
A 12-byte condition token representing the current condition or feedback information.
c_1 (output)
A 2-byte binary integer representing the value of the first 2 bytes of the condition_ID.
c_2 (output)
A 2-byte binary integer representing the value of the second 2 bytes of the condition_ID. See CEENCOD—Construct a condition token for a detailed explanation of the condition_ID.
case (output)
A 2-byte binary integer field defining the format of the condition_ID portion of the token. A value of 1 identifies a case 1 condition. A value of 2 identifies a case 2 condition. The values 0 and 3 are reserved.
severity (output)
A 2-byte binary integer representing the severity of the condition. severity specifies the following values:
0
Information only (or, if the entire token is zero, no information).
1
Warning—service completed, probably correctly.
2
Error detected—correction attempted; service completed, perhaps incorrectly.
3
Severe error—service not completed.
4
Critical error—service not completed; condition signaled. A critical error is a condition that jeopardizes the environment. If a critical error occurs during a Language Environment callable service, instead of returning synchronously to the caller, the condition manager is always signaled.
control (output)
A 2-byte binary integer containing flags describing aspects of the state of the condition. Valid values for the control field are 1 and 0.
1
Indicates that the facility_ID is assigned by IBM®.
0
indicates the facility_ID is assigned by the user.
facility_ID (output)
A 3-character field containing three alphanumeric characters identifying the product generating the condition or feedback information.
i_s_info
A fullword binary integer that identifies the ISI associated with the given instance of the condition represented by the condition token where it is contained. If an ISI is not associated with a given condition token, the i_s_info field contains a value of binary zero.
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.
CEE036 3 0102 An unrecognized condition token was passed to routine and could not be used.

Usage notes

  • C/C++ considerations—The structure of the condition token (type_FEEDBACK) is described in the leawi.h header file shipped with Language Environment. C users can assign values directly to the fields of the token in the header file without using the CEENCOD service. The layout of the type_FEEDBACK condition token in the header file is shown in Figure 1.
  • z/OS UNIX consideration—In multithread applications, CEEDCOD affects only the calling thread.

For more information

Examples

  1. Following shows an example of CEEDCOD being called by C/C++.
    /*Module/File Name: EDCDCOD   */
    
    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <leawi.h>
    #include <ceeedcct.h>
    
    /****************************************************/
    /* In C/C++ it is not necessary to use this service.*/
    /* The fields can be manipulated directly.  See the */
    /* example for CEESGL to see how to manipulate      */
    /* condition token fields directly.                 */
    /****************************************************/
    
    int main(void) {
    
      _FEEDBACK fc,newfc;
      _INT2 c_1,c_2,cond_case,sev,control;
      _CHAR3 facid;
      _INT4 isi, heapid, size;
      _POINTER address;
    
      heapid = 0;
      size = 4000;
    
      CEEGTST(&heapid,&size,&address,&fc);
      if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
         printf("CEEGTST failed with msgno %d\n",
           fc.tok_msgno);
         exit(2999);
      }
    
      /* decompose the feedback token to check for errors */
      CEEDCOD(&fc,&c_1,&c_2,&cond_case,&sev,&control,facid,;
              &isi,&newfc);
    
      if ( _FBCHECK ( newfc , CEE000 ) != 0 ) {
         printf("CEEDCOD failed with msgno %d\n",
           newfc.tok_msgno);
         exit(2889);
      }
      if (c_1 != 0 || c_2 != 0)
         printf(
         "c_1 and c_2 returned from CEEDCOD should be 0\n");
     /*
     ⋮ */
    }
  2. Following an example of CEEDCOD being called by COBOL.
    CBL LIB,QUOTE
          *Module/File Name: IGZTDCOD
          ***********************************************
          **                                           **
          ** Function: CEEDCOD - Decompose a condition **
           **                     token                **
          **                                           **
          ** In this example, a call is made to        **
          ** CEEGTST in order to obtain a condition    **
          ** token to use in the call to CEEDCOD.      **
          ** A call could also have been made to any   **
          ** other Lang Env svc., or a condition token **
          ** could have been constructed using         **
          ** CEEDCOD.                                  **
          **                                           **
          ***********************************************
           IDENTIFICATION DIVISION.
           PROGRAM-ID. CBLDCOD.
           DATA DIVISION.
           WORKING-STORAGE SECTION.
           01  HEAPID                  PIC S9(9) BINARY.
           01  HPSIZE                  PIC S9(9) BINARY.
           01  ADDRSS                  USAGE POINTER.
           01  SEV                     PIC S9(4) BINARY.
           01  MSGNO                   PIC S9(4) BINARY.
           01  CASE                    PIC S9(4) BINARY.
           01  SEV2                    PIC S9(4) BINARY.
           01  CNTRL                   PIC S9(4) BINARY.
           01  FACID                   PIC X(3).
           01  ISINFO                  PIC S9(9) BINARY.
           01  FC.
               02  Condition-Token-Value.
               COPY  CEEIGZCT.
                   03  Case-1-Condition-ID.
                       04  Severity    PIC S9(4) BINARY.
                       04  Msg-No      PIC S9(4) BINARY.
                   03  Case-2-Condition-ID
                             REDEFINES Case-1-Condition-ID.
                       04  Class-Code  PIC S9(4) BINARY.
                       04  Cause-Code  PIC S9(4) BINARY.
                   03  Case-Sev-Ctl    PIC X.
                   03  Facility-ID     PIC XXX.
               02  I-S-Info            PIC S9(9) BINARY.
           01  FC2.
               02  Condition-Token-Value.
               COPY  CEEIGZCT.
                   03  Case-1-Condition-ID.
                       04  Severity    PIC S9(4) BINARY.
                       04  Msg-No      PIC S9(4) BINARY.
                   03  Case-2-Condition-ID
                             REDEFINES Case-1-Condition-ID.
                       04  Class-Code  PIC S9(4) BINARY.
                       04  Cause-Code  PIC S9(4) BINARY.
                   03  Case-Sev-Ctl    PIC X.
                   03  Facility-ID     PIC XXX.
               02  I-S-Info            PIC S9(9) BINARY.
    
           PROCEDURE DIVISION.
          *************************************************
          ** Call any Lang Env svc to receive a condition**
          **     token to use as input to CEEDCOD.       **
          *************************************************
    
          PARA-CBLGTST.
          ************************************************
          ** Specify 0 to get storage from the initial  **
          **     heap.                                  **
          ** Specify 4000 to get 4000 bytes of storage. **
          ** Call CEEGTST to obtain storage.            **
          ************************************************
    
               MOVE 0 TO HEAPID.
               MOVE 4000 TO HPSIZE.
    
               CALL "CEEGTST" USING HEAPID, HPSIZE,
                                    ADDRSS, FC.
    
           PARA-CBLDCOD.
          ************************************************
          ** Use the FC returned from CEEGTST as an     **
          **     input condition token to CEEDCOD.      **
          ************************************************
    
               CALL "CEEDCOD" USING FC, SEV, MSGNO, CASE,
                                    SEV2, CNTRL, FACID,
                                    ISINFO, FC2.
               IF CEE000 of FC2  THEN
                   DISPLAY "CEEGTST completed with msg "
                       MSGNO ", Severity " SEV ", Case "
                       CASE ", Control " CNTRL ", and "
                       "Instance-Specific Information of "
                       ISINFO "."
               ELSE
                   DISPLAY "CEEDCOD failed with msg "
                       Msg-No of FC2 UPON CONSOLE
               END-IF.
               GOBACK.
  3. Following is an example of CEEDCOD called by PL/I.
    *PROCESS MACRO;
     /*Module/File Name: IBMDCOD                        */
     /***************************************************/
     /**                                               **/
     /** Function: CEEDCOD - decompose a condition     **/
     /**                     token                     **/
     /**                                               **/
     /** In this example, a call is made to CEEGTST to **/
     /** receive a condition token to decompose.       **/
     /** A call could have been made to any LE/370     **/
     /** service. The condition token returned by      **/
     /** CEEGTST is used as input to CEEDCOD.          **/
     /**                                               **/
     /***************************************************/
     PLIDCOD: PROC OPTIONS(MAIN);
    
        %INCLUDE  CEEIBMAW;
        %INCLUDE  CEEIBMCT;
    
        DCL HEAPID  REAL FIXED BINARY(31,0);
        DCL STGSIZE REAL FIXED BINARY(31,0);
        DCL ADDRSS  POINTER;
        DCL 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);
        DCL SEV     REAL FIXED BINARY(15,0);
        DCL MSGNO   REAL FIXED BINARY(15,0);
        DCL CASE    REAL FIXED BINARY(15,0);
        DCL SEV2    REAL FIXED BINARY(15,0);
        DCL CNTRL   REAL FIXED BINARY(15,0);
        DCL FACID   CHARACTER ( 3 );
        DCL ISINFO  REAL FIXED BINARY(31,0);
        DCL 01 FC2,                    /* 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);
    
        HEAPID = -1;    /* invalid heap ID               */
        STGSIZE = 4000; /* request 4000 bytes of storage */
    
        /* Call any service (in this case, CEEGTST) to   */
        /*       create a condition token to decompose   */
        CALL CEEGTST ( HEAPID , STGSIZE , ADDRSS , FC );
        /* Call CEEDCOD with the condition token         */
        /*    returned in FC from CEEGTST                */
        CALL CEEDCOD ( FC , SEV , MSGNO , CASE , SEV2 ,
              CNTRL , FACID , ISINFO , FC2 );
        IF  FBCHECK( FC2, CEE000)  THEN  DO;
           PUT SKIP LIST( 'Feedback token from CEEGTST has'
              || ' Severity of ' || SEV
              || ', Message number of ' || MSGNO
              || ', Case of ' || CASE || ',' );
           PUT SKIP LIST( '   Severity 2 of ' || SEV2
              || ', Control of ' || CNTRL
              || ', Facility ID of ' || FACID
              || ', and I-S-Info of ' || ISINFO || '.' );
           END;
        ELSE  DO;
           DISPLAY( 'CEEDCOD failed with msg '
              || FC2.MsgNo );
           STOP;
           END;
     END PLIDCOD;