|
CEECMI copies message insert data
and loads the address of that data into the Instance Specific Information
(ISI) associated with the condition being processed. CEECMI also allocates
storage for the ISI, if necessary. The number of ISIs per thread is
determined by the MSGQ runtime option. ISIs are released when the
value specified in the MSGQ runtime option is exceeded. The least
recently used ISI is overwritten.
If you plan on using a routine
that signals a new condition with a call to the CEESGL callable service,
you should first call CEECMI to copy any insert information into the
ISI associated with the condition.
Syntax
>>-CEECMI--(--cond_rep--,-- insert_seq_num--,--insert_data--,--->
>--fc--)-------------------------------------------------------><
- cond_rep (input/output)
- A condition token that defines the condition
for which the q_data_token is retrieved.
- insert_seq_num (input)
- A 4-byte integer that contains the insert sequence number (such
as insert 1 insert 2). It corresponds to an insert number specified
with an ins tag in the message source file created
by the CEEBLDTX EXEC.
- insert_data (input)
- A halfword-prefixed length string that represents the insert data.
The entire length described in the halfword prefix is used without
truncation. DBCS strings must be enclosed within shift-out (X'0E')
and shift-in (X'0F') characters. The maximum size for an
individual insert data item is 254 bytes.
- 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 arise from this service:
Code |
Severity |
Message number |
Message text |
---|
CEE000 |
0 |
— |
The service completed successfully. |
CEE0EB |
3 |
0459 |
Not enough storage was available to create a new instance specific
information block. |
CEE0EC |
1 |
0460 |
Multiple instances of the condition token with message number message-number and
facility ID facility-id were detected. |
CEE0ED |
3 |
0461 |
The maximum number of unique message insert blocks was reached.
This condition token had its I_S_info field set to 1. |
CEE0EE |
3 |
0462 |
Instance specific information for the condition token with
message number message-number and facility ID facility-id could
not be found. |
CEE0EF |
3 |
0463 |
The maximum size for an insert data item was exceeded. |
CEE0H9 |
3 |
0553 |
An internal error was detected in creating the inserts for
a condition. |
Usage notes - z/OS UNIX consideration—In
multithread applications, CEECMI applies to message insert data for
only the calling thread.
Examples - Following is an example of CEECMI called by C/C++.
/*Module/File Name: EDCCMI */
/**************************************************
** *
** FUNCTION: CEENCOD - set up a condition token *
** : CEECMI - store and load message *
** insert data *
** : CEEMSG - retrieve, format, and *
** dispatch a message to *
** message file *
** *
** This example illustrates the invocation of *
** the Lang. Environ. message services to *
** store and load message insert data. *
** The resulting message and insert is written *
** to the Lang. Environ. MSGFILE ddname. *
** *
**************************************************/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <leawi.h>
#include <ceeedcct.h>
void main ()
{
_INT2 c_1,c_2,cond_case,sev,control;
_CHAR3 facid;
_INT4 isi;
_VSTRING insert;
_FEEDBACK ctok;
_FEEDBACK fbcode;
_INT4 MSGFILE;
_INT4 insert_no ;
/* Condition Token Declarations */
/****************************************************
* EXMPLMSG is a token that represents message *
* number 10 in a user message file constructed *
* using the CEEBLDTXT facility. *
* Message 10 is designed to allow one insert. *
****************************************************/
insert.length = 18;
memcpy(insert.string ,"<CEPGCMI's insert>",
insert.length);
/*give ctok value of hex 0000000A40E7D4D700000000 */
/*sev = 0 msgno = 10 facid = XMP */
c_1 = 0;
c_2 = 10;
cond_case = 1;
sev = 0;
control = 0;
memcpy(facid,"XMP",3);
isi = 0;
/********************************************/
/* Call CEENCOD to set-up a condition token */
/********************************************/
CEENCOD(&c_1,&c_2,&cond_case,&sev,&control,;
facid,&isi,&ctok,&fbcode);
if ( _FBCHECK ( fbcode , CEE000 ) != 0 )
printf("CEENCOD failed with message number %d\n",
fbcode.tok_msgno);
/******************************************/
/* Call CEECMI to create a message insert */
/******************************************/
CEECMI(&ctok, &insert_no, &insert, &fbcode);
if ( _FBCHECK ( fbcode , CEE000 ) != 0 )
printf("CEECMI failed with message number %d\n",
fbcode.tok_msgno);
/******************************************/
/* Call CEEMSG to issue the message */
/******************************************/
CEEMSG(&ctok, &MSGFILE , &fbcode);
if ( _FBCHECK ( fbcode , CEE000 ) != 0 )
printf("CEEMSG failed with message number %d\n",
fbcode.tok_msgno);
}
- Following is an example of CEECMI called by COBOL.
CBL LIB,QUOTE
*Module/File Name: IGZTCMI
***********************************************
** *
** Function: CEECMI - Store and load message *
** insert data *
** : CEENCOD - Construct a condition *
** token *
** : CEEMSG - Dispatch a Message. *
** *
** This example illustrates the invocation *
** of the Lang. Environ. message services to*
** store and load message insert data. *
** CEENCOD is called to construct a token *
** for a user defined message (message 10) *
** in a user message file. *
** CEECMI is called to insert text into *
** message 10. The resulting message and *
** insert is written to the MSGFILE. *
** *
***********************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. CBLCMI.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INSERTNO PIC S9(9) BINARY.
01 CTOK PIC X(12).
01 FBCODE.
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 MSGDEST PIC S9(9) BINARY.
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 VSTRING.
05 INSERT-TXTL PIC S9(4) BINARY.
05 INSERT-TXT PIC X(80).
PROCEDURE DIVISION.
PARA-CEPGCMI.
************************************************
* Set up token fields for creation of a *
* condition token for the user defined *
* message file and message number. *
************************************************
MOVE 0 TO SEV.
MOVE 10 TO MSGNO.
MOVE 1 TO CASE.
MOVE 0 TO SEV2.
MOVE 0 TO CNTRL.
MOVE "XMP" TO FACID.
MOVE 0 TO ISINFO.
************************************************
* Call CEENCOD to construct a condition token *
************************************************
CALL "CEENCOD" USING SEV, MSGNO, CASE,
SEV2, CNTRL, FACID,
ISINFO, CTOK, FBCODE.
IF NOT CEE000 of FBCODE THEN
DISPLAY "CEENCOD failed with msg"
Msg-No of FBCODE UPON CONSOLE
STOP RUN
END-IF.
***********************************************
* Call CEECMI to store and load message *
* insert 1. *
***********************************************
MOVE "<CEPGCMI""s insert>" TO INSERT-TXT.
MOVE 19 TO INSERT-TXTL.
MOVE 1 TO INSERTNO.
CALL "CEECMI" USING CTOK, INSERTNO, VSTRING.
***********************************************
* Call CEEMSG to write message to MSGFILE *
***********************************************
MOVE 2 TO MSGDEST.
CALL "CEEMSG" USING CTOK, MSGDEST, FBCODE.
IF NOT CEE000 of FBCODE THEN
DISPLAY "CEEMSG failed with msg "
Msg-No of FBCODE UPON CONSOLE
STOP RUN
END-IF.
GOBACK.
- Following is an example of CEECMI called by PL/I.
*PROCESS MACRO;
IBMCMI: Proc Options(Main);
/*Module/File Name: IBMCMI */
/***************************************************
** *
** FUNCTION : CEECMI - store and load message *
** insert data *
** : CEEMSG - retrieve, format, and *
** dispatch a message to *
** message file *
** *
** This example illustrates the invocation of *
** LE/370 message services to store and load *
** message insert data. The resulting message *
** and insert are written to the MSGFILE. *
** *
**************************************************/
%INCLUDE CEEIBMAW;
%INCLUDE CEEIBMCT;
DECLARE INSERT CHAR(255) VARYING;
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 REAL FIXED BINARY(31,0);
DECLARE INSERT_NO REAL FIXED BINARY(31,0);
/*************************************************/
/* Ctok is initialized in the DECLARE statement */
/* to message 10 in a user message file */
/* constructed using the CEEBLDTX tool. */
/* Message 10 is designed to allow one insert. */
/* The message facility ID is XMP. */
/*************************************************/
insert = '<CEPGCMI's insert>';
insert_no = 1;
/******************************************/
/* Call CEECMI to create a message insert */
/******************************************/
Call CEECMI(ctok, insert_no, insert, *);
/******************************************/
/* Call CEEMSG to issue the message */
/******************************************/
MSGFILE = 2;
Call CEEMSG(ctok, MSGFILE, *);
End IBMCMI;
|