CEEGQDT—Retrieve q_data_token
CEEGQDT retrieves the q_data_token from the Instance-Specific Information (ISI). CEEGQDT is particularly useful when you have user-written condition handlers registered by CEEHDLR.
Syntax >>-CEEGQDT--(--cond_rep--,--q_data_token--,--fc--)-------------><
- cond_rep (input)
- A condition token defining the condition for which the q_data_token is retrieved.
- q_data_token (output)
- A pointer to the q_data associated with condition token cond_rep.
- 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. CEE0EE 3 0462 Instance-specific information for the condition token with message number message-number and facility ID facility-id could not be found. CEE0EG 3 0464 Instance-specific information for the condition token with message number message-number and facility ID facility-id did not exist.
Usage notes
- z/OS UNIX consideration—In multithread applications, CEEGQDT affects only the calling thread.
For more information
- For more information about the various types of q_data structures, see z/OS Language Environment Programming Guide.
- For more information about the CEEHDLR callable service, see CEEHDLR—Register user-written condition handler.
- For more information about the CEESGL callable service, see CEESGL—Signal a condition.
Examples
- Following is an example of CEEGQDT called by C/C++.
/*Module/File Name: EDCGQDT */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <leawi.h> #include <ceeedcct.h> #ifdef __cplusplus extern "C" { #endif void handler(_FEEDBACK *,_INT4 *,_INT4 *,_FEEDBACK *); #ifdef __cplusplus } #endif typedef struct { /* condition info structure */ int error_value; char err_msg_80¨; int retcode; } info_struct; int main(void) { _FEEDBACK fc,condtok; _ENTRY routine; _INT4 token,qdata; _INT2 c_1,c_2,cond_case,sev,control; _CHAR3 facid; _INT4 isi; info_struct *info; /* . . . */ /* register the condition handler */ token = 99; routine.address = (_POINTER)&handler;; routine.nesting = NULL; CEEHDLR(&routine,&token,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEEHDLR failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ /* set up the condition info structure */ info = (info_struct *)malloc(sizeof(info_struct)); if (info == NULL) { printf("error allocating info_struct\n"); exit(2399); } info->error_value = 86; strcpy(info->err_msg,"Test message"); info->retcode = 99; /* set qdata to be the condition info structure */ qdata = (int)info; /* build the condition token */ c_1 = 3; c_2 = 99; cond_case = 1; sev = 3; control = 0; memcpy(facid,"ZZZ",3); isi = 0; CEENCOD(&c_1,&c_2,&cond_case,&sev,&control,; facid,&isi,&condtok,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEENCOD failed with message number %d\n", fc.tok_msgno); exit(2999); } /* signal the condition */ CEESGL(&condtok,&qdata,&fc); if ( _FBCHECK ( fc , CEE000 ) != 0 ) { printf("CEESGL failed with message number %d\n", fc.tok_msgno); exit(2999); } /* . . . */ } void handler(_FEEDBACK *fc, _INT4 *token, _INT4 *result, _FEEDBACK *newfc) { _FEEDBACK qdatafc; _INT4 idata; info_struct *qdata; /* . . . */ /* get the q_data_token from the ISI */ CEEGQDT(fc, &idata, &qdatafc); if ( _FBCHECK ( qdatafc , CEE000 ) != 0 ) { printf("CEEGQDT failed with message number %d\n", qdatafc.tok_msgno); *result = 20; /* percolate */ return; } /************************************************/ /* set info_struct pointer to address return by */ /* CEEGQDT */ /************************************************/ qdata = (info_struct *) idata; /* use the condition info structure (qdata) */ if (qdata->error_value == 86) { printf("%.12s\n",qdata->err_msg); printf("retcode = %d\n",qdata->retcode); *result = 10; /* resume this is what we want */ return; } /* . . . */ *result = 20; /* percolate */ }
- Following is an example of CEEGQDT called by COBOL.
CBL LIB,QUOTE *Module/File Name: IGZTGQDT ************************************************* ** DRVGQDT - Drive sample program for CEEGQDT ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. DRVGQDT. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN 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 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 QDATA PIC S9(9) BINARY. 01 CONDTOK. 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. ** Register handler SET ROUTINE TO ENTRY "CBLGQDT". CALL "CEEHDLR" USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY "CEEHDLR failed with msg " Msg-No of FC UPON CONSOLE STOP RUN END-IF. ** Signal a condition MOVE 1 TO QDATA. SET CEE001 of CONDTOK to TRUE. MOVE ZERO to I-S-Info of CONDTOK. CALL "CEESGL" USING CONDTOK , QDATA , FC. IF CEE000 of FC THEN DISPLAY "**** Resumed execution in the " "routine which registered the handler" ELSE DISPLAY "CEESGL failed with msg " Msg-No of FC UPON CONSOLE END-IF. ** UNregister handler CALL "CEEHDLU" USING ROUTINE , TOKEN , FC. IF NOT CEE000 of FC THEN DISPLAY "CEEHDLU failed with msg " Msg-No of FC UPON CONSOLE END-IF. STOP RUN. END PROGRAM DRVGQDT. ****************************************** ** CBLGQDT - Call CEEGQDT to get ** ** the Q_DATA_TOKEN ** ****************************************** IDENTIFICATION DIVISION. PROGRAM-ID. CBLGQDT. DATA DIVISION. WORKING-STORAGE SECTION. 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 QDATA PIC S9(9) BINARY. LINKAGE SECTION. 01 CURCOND. 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 TOKEN PIC S9(9) BINARY. 01 RESULT PIC S9(9) BINARY. 88 RESUME VALUE 10. 01 NEWCOND. 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 USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-CBLGQDT. ** Obtain the Qdata for the current condition CALL "CEEGQDT" USING CURCOND , QDATA , FC. IF CEE000 of FC THEN DISPLAY "QDATA for " Facility-ID of CURCOND Msg-No of CURCOND " is " QDATA ELSE DISPLAY "CEEGQDT failed with msg " Msg-No of FC UPON CONSOLE END-IF. SET RESUME TO TRUE. GOBACK. END PROGRAM CBLGQDT.
- The following example uses a COBOL program and handler to establish
the condition handling environment prior to calling a PL/I subroutine
to illustrate the use of the callable service from PL/I.
CBL LIB,QUOTE *Module/File Name: IGZTGQDP ************************************************* ** IGZTGQDP - Drive sample program for CEEGQDT ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. IGZTGQDP. DATA DIVISION. WORKING-STORAGE SECTION. 01 ROUTINE PROCEDURE-POINTER. 01 TOKEN 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 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 QDATA PIC S9(9) BINARY. 01 CONDTOK. 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. ** Register handler SET ROUTINE TO ENTRY "HDLGQDT". CALL "CEEHDLR" USING ROUTINE, TOKEN, FC. IF NOT CEE000 of FC THEN DISPLAY "CEEHDLR failed with msg " Msg-No of FC UPON CONSOLE STOP RUN END-IF. ** Signal a condition MOVE 1 TO QDATA. SET CEE001 of CONDTOK to TRUE. MOVE ZERO to I-S-Info of CONDTOK. CALL "CEESGL" USING CONDTOK, QDATA, FC. IF CEE000 of FC THEN DISPLAY "**** Resumed execution in the " "routine which registered the handler" ELSE DISPLAY "CEESGL failed with msg " Msg-No of FC UPON CONSOLE END-IF. ** UNregister handler CALL "CEEHDLU" USING ROUTINE, FC. IF NOT CEE000 of FC THEN DISPLAY "CEEHDLU failed with msg " Msg-No of FC UPON CONSOLE END-IF. STOP RUN. END PROGRAM IGZTGQDP. ************************************************* ** HDLGQDT -- COBOL condition handler to call ** ** PL/I routine for actual work. ** ************************************************* IDENTIFICATION DIVISION. PROGRAM-ID. HDLGQDT. DATA DIVISION. LINKAGE SECTION. 01 CURCOND. 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 TOKEN PIC S9(9) BINARY. 01 RESULT PIC S9(9) BINARY. 01 NEWCOND. 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 USING CURCOND, TOKEN, RESULT, NEWCOND. PARA-CBLGQDT. ** Invoke the PL/I routine to handle condition CALL "IBMGQDT" USING ADDRESS OF CURCOND, ADDRESS OF TOKEN, ADDRESS OF RESULT, ADDRESS OF NEWCOND. GOBACK. END PROGRAM HDLGQDT.
- Following is an example of CEEGQDT called by COBOL.
*PROCESS OPT(0), MACRO; /* Module/File Name: IBMGQDT */ /****************************************************/ /** **/ /** Function: CEEGQDT -- get qualifying data **/ /** **/ /****************************************************/ IBMGQDT: PROC (@CONDTOK, @TOKEN, @RESULT, @NEWCOND) OPTIONS(COBOL); %INCLUDE CEEIBMAW; %INCLUDE CEEIBMCT; /* Parameters */ DCL @CONDTOK POINTER; DCL @TOKEN POINTER; DCL @RESULT POINTER; DCL @NEWCOND POINTER; DCL 01 CONDTOK BASED(@CONDTOK), /* 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 TOKEN BASED(@TOKEN) REAL FIXED BIN(31,0); DCL RESULT BASED(@RESULT) REAL FIXED BIN(31,0); DCL 01 NEWCOND BASED(@NEWCOND), /* 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); /* Local identifiers */ DCL QDATA 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); IF FBCHECK(CONDTOK, CEE001) THEN /* expected */ DO; /* Call CEEGQDT with condition token defined */ /* above to retrieve associated q_data */ CALL CEEGQDT ( CONDTOK, QDATA, FC ); IF FBCHECK( FC, CEE000) THEN DO; PUT SKIP LIST( 'Qualifying data for current ' || ' condition is ' || QDATA ); RESULT = 10 /* Resume */; END; ELSE DO; DISPLAY('CEEGQDT failed with msg ' || FC.MsgNo); NEWCOND = FC; RESULT = 30 /* Promote */; END; END; ELSE /* Unexpected condition -- percolate */ DO; DISPLAY( 'User condition handler entered for ' || CONDTOK.FacID || ' condition...'); DISPLAY( '... with message number ' || CONDTOK.MsgNo); RESULT = 20 /* Percolate */; END; RETURN; END IBMGQDT;