PL/I

The example in Figure 1 includes the symbolic feedback code file CEEIBMCT so that Language Environment feedback codes (with facility ID CEE) will be defined. FBCHECK (IBM-supplied) is called to compare the first 8 bytes of FC with the symbolic feedback code CEE000 to determine if the call to CEEMGET is successful. If it is, the message associated with feedback code CEE001 is printed.

Figure 1. PL/I example testing for symbolic feedback code CEE000
*PROCESS MACRO;
 /* Module/File Name: IBMMGET                        */
 /****************************************************/
 /**                                                **/
 /**Function       : CEEMGET - Get a Message        **/
 /**                                                **/
 /****************************************************/
 PLIMGET: PROC OPTIONS(MAIN);

    %INCLUDE  CEEIBMAW;
    %INCLUDE  CEEIBMCT;

    DCL 01 CONTOK,                 /* 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 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 MSGBUF      CHAR(80);
    DCL MSGPTR      REAL FIXED BINARY(31,0);

    /* Give CONTOK value of condition CEE001         */
    ADDR( CONTOK ) -> CEEIBMCT = CEE001;
    MSGPTR = 0;

    /* Call CEEMGET to retrieve msg corresponding    */
    /*    to condition token                         */
    CALL CEEMGET ( CONTOK, MSGBUF, MSGPTR, FC );
    IF  FBCHECK( FC, CEE000)  THEN  DO;
       PUT SKIP LIST( 'Message text for message number'
          || CONTOK.MsgNo || ' is "' || MSGBUF || '"');
       END;
    ELSE  DO;
       DISPLAY( 'CEEMGET failed with msg '
          || FC.MsgNo );
       STOP;
       END;

 END PLIMGET;