|
CEEMSG
gets, formats, and dispatches a message corresponding
to an input condition token received from a callable service or passed
to a user-written condition handler. You can use this service to print
a message after a call to any Language Environment service
that returns a condition token.
Syntax
>>-CEEMSG--(--cond_token--,--destination_code--,--fc--)--------><
- cond_token (input)
- A 12-byte condition token received as the
result of a Language Environment callable
service.
- destination_code (input)
- A 4-byte binary integer. destination_code can
be specified only as 2, meaning write the message to the ddname of
the file specified in the MSGFILE runtime option .
- 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. |
CEE0E2 |
3 |
0450 |
The message inserts for the condition token with message number message-number and
facility ID facility-id could not be located. |
CEE0E3 |
3 |
0451 |
An invalid destination code destination-code was
passed to routine routine-name. |
CEE0E6 |
3 |
0454 |
The message number message-number could
not be found for facility ID facility-id. |
CEE0E9 |
3 |
0457 |
The message file destination ddname could
not be located. |
CEE0EA |
3 |
0458 |
The message repository repository-name could
not be located. |
CEE3CT |
3 |
3485 |
An internal message services error occurred while locating
the message number within a message file. |
CEE3CU |
3 |
3486 |
An internal message services error occurred while formatting
a message. |
CEE3CV |
3 |
3487 |
An internal message services error occurred while locating
a message number within the ranges specified in the repository. |
Usage notes - z/OS UNIX considerations—In
multithread applications, CEEMSG affects only the calling thread.
When multiple threads write to the message file, the output is interwoven
by line. To group lines of output, serialize MSGFILE access (by using
a mutex, for example).
Examples - Following is an example of CEEMSG called by C/C++.
/*Module/File Name: EDCMSG */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <leawi.h>
#include <ceeedcct.h>
int main(void) {
_VSTRING message;
_INT4 dest,msgindx;
_CHAR80 msgarea;
_FEEDBACK fc,token;
strcpy(message.string,"This is a test message");
message.length = strlen(message.string);
dest = 5; /* invalid dest so CEEMOUT will fail */
CEEMOUT(&message,&dest,&fc);
if ( _FBCHECK ( fc , CEE000 ) != 0 ) {
/* put the message if CEEMOUT failed */
dest = 2;
CEEMSG(&fc,&dest,NULL);
exit(2999);
}
}
- Following is an example of CEEMSG called by COBOL.
CBL LIB,QUOTE
*Module/File Name: IGZTMSG
*************************************************
** **
** CBLMSG - Call CEEMSG to get, format and **
** dispatch a message **
** **
** In this example, CEE3MDS is called with an **
** invalid country code so that a condition **
** token would be returned to use as input to **
** Any Lang Env service could have been called.**
** CEEMSG uses the condition token to get, **
** format and dispatch the message associated **
** with the condition that occurred in CEE3MDS.**
** **
*************************************************
IDENTIFICATION DIVISION.
PROGRAM-ID. CBLMSG.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 COUNTRY PIC X(2).
01 DECSEP PIC X(2).
01 MSGDEST 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.
PARA-CBL3MDS.
*************************************************
** Call a Lang Env svc, CEE3MDS in this case, **
** to receive a condition token that CEEMSG **
** can format as a message. Specify an **
** invalid value for country code so that a **
** condition will be built **
*************************************************
MOVE "LN" TO COUNTRY.
CALL "CEE3MDS" USING COUNTRY, DECSEP, FC.
PARA-CBLMSG.
*************************************************
** Specify 2 for destination, so message will **
** be written to the ddname specified or **
** defaulted in the MSGFILE runtime option. **
*************************************************
MOVE 2 TO MSGDEST.
*************************************************
** Call CEEMSG using the FC returned from **
** CEE3MDS as the input condition token. **
*************************************************
CALL "CEEMSG" USING FC, MSGDEST, FC2.
IF NOT CEE000 of FC2 THEN
DISPLAY "CEEMSG failed with msg "
Msg-No of FC2 UPON CONSOLE
STOP RUN
END-IF.
GOBACK.
- Following is an example of CEEMSG called by PL/I.
*PROCESS LANGLVL(SAA), MACRO;
/* Module/File Name: IBMMSG */
/****************************************************/
/** **/
/** Function: CEEMSG - get, format and dispatch **/
/** a message **/
/** **/
/** In this example, CEE3MDS is called with an **/
/** invalid country code so that a condition token **/
/** would be returned to use as input to CEEMSG. **/
/** Any LE/370 could have been called. CEEMSG uses **/
/** the condition to get, format and dispatch the **/
/** message associated with the condition that **/
/** occurred in CEE3MDS **/
/** **/
/****************************************************/
PLIMSG: PROC OPTIONS(MAIN);
%INCLUDE CEEIBMAW;
%INCLUDE CEEIBMCT;
DCL COUNTRY CHARACTER ( 2 );
DCL DECSEP CHARACTER ( 2 );
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 MSGDEST 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);
COUNTRY = 'LN'; /* Specify an invalid country */
/* code to receive a non-zero */
/* feedback code */
/* Call any service (CEE3MDS in this case) to */
/* receive a condition token that CEEMSG will */
/* format and dispatch a message */
CALL CEE3MDS ( COUNTRY, DECSEP, FC );
MSGDEST = 2; /* Specify 2 as destination, so */
/* message will go to ddname speci- */
/* fied in MSGFILE runtime option */
CALL CEEMSG ( FC, MSGDEST, FC2 );
IF ¬ FBCHECK( FC2, CEE000) THEN DO;
DISPLAY( 'CEEMSG failed with msg '
|| FC.MsgNo );
STOP;
END;
END PLIMSG;
|