Assigning values to message inserts

After you add message insert tags to the message source file, you can use the Language Environment callable service CEECMI to assign values to the inserts. Values do not need to be assigned to inserts in sequential order. For example, the value of insert 3 can be assigned before the value for insert 1. Before invoking the CEECMI callable service, assign values to the callable service parameters. For more information about CEECMI, see z/OS Language Environment Programming Reference.

Figure 1 shows an example of the use of CEECMI to assign value 1234 to insert 1 for :msgname.EXMPLMSG shown in Figure 1.

Figure 1. Example of assigning values to message inserts
*PROCESS MACRO;
 TEST: Proc Options(Main);

 /*Module/File Name: IBMMINS          */

    %INCLUDE  CEEIBMAW;
    %INCLUDE  CEEIBMCT;

    %INCLUDE SYSLIB(EXMPLCOP);
    DECLARE INSERT    CHAR(255) VARYING  AUTO;
    DCL 01 CTOK,                    /* 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 FBCODE,                  /* 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);
    DECLARE MSGFILE   FIXED AUTO;

    ctok = EXMPLMSG;
    insert = '1234';
    MSGFILE = 2;

    /* Call CEECMI to create a message insert */
    CALL CEECMI(ctok, 1, insert, fbcode);

    /* Call CEEMSG to issue the message */
    CALL CEEMSG(ctok, MSGFILE, fbcode);

 END TEST;