Setting an enhanced trap on MQ Message Data (MQD) for Code Debug CICS COBOL
Related Topics
Type XPED CSQ4CVB1 on a blank CICS screen and press Enter. The IBM-supplied sample IBM MQ for z/OS program CSQ4CVB1 is displayed on the Source Listing screen (2.L) as shown in following figure.
CSQ4CVB1 on the Source Listing Screen (2.L)-------------------------------- SOURCE LISTING (2.L) ---------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CSQ4CVB1 CSECT: CSQ4CVB1 COMPILED: 28 JUN 2002 - 15.00.43
------ --------------------------------------------------------------------->
002896 MOVE SPACES TO M00-MESSAGE.
002897 MOVE LOW-VALUES TO CSQ4VB1O.
002898 *
002899 PERFORM INQUIRE-DEPTH
002900 *
002901 * If the depth cannot be obtained, there is no pos
002902 * that the program can work - so exit with a messa
002903 *
002904 IF M00-MESSAGE NOT = SPACES THEN
002905 1 STRING EIBTRNID
002906 1 M01-MESSAGE-14
002907 1 DELIMITED BY SIZE INTO M00-MESSAGE
002908 1 GO TO A-MAIN-EXIT
002909 END-IF.
002910 *
002911 *EXEC CICS IGNORE CONDITION
002912 * MAPFAIL
002913 *END-EXEC.
002914 MOVE ' 00630 ' TO DFHEIV
002915 CALL 'DFHEI1' USING DFHEIV0.Type BEFORE 2896 in the COMMAND field and press Enter. This sets a before breakpoint on statement 2896. As shown in following figure, Code Debug displays the message
*********************** BEFORE SET ************************
Setting a Breakpoint on the Source Listing Screen (2.L)---------------------------------- SOURCE LISTING (2.L) ------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CSQ4CVB1 *********************** BEFORE SET ***********************
------ --------------------------------------------------------------------->
002896 B MOVE SPACES TO M00-MESSAGE.
002897 MOVE LOW-VALUES TO CSQ4VB1O.
002898 *
002899 PERFORM INQUIRE-DEPTH
002900 *
002901 * If the depth cannot be obtained, there is no pos
002902 * that the program can work - so exit with a messa
002903 *
002904 IF M00-MESSAGE NOT = SPACES THENType =1.6 in the COMMAND field and press Enter. The Trap Summary screen (1.6) is displayed (Displaying a Trap on the Trap Summary Screen (1.6)) showing the trap Code Debug automatically created based on netname and terminal ID.
The breakpoints you set will only be taken when the task is running on netname ACME0027 and terminal 0027. Abends for that netname and terminal will also be trapped.Displaying a Trap on the Trap Summary Screen (1.6)
----------------------------------- TRAP SUMMARY (1.6) -------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CSQ4CVB1 CSECT: CSQ4CVB1 COMPILED: 28 JUN 2002 - 15.00.43
MODE: TERM (IP TERM or ALL) NO IP TRAPS ENTRY 000001
LINE COMMANDS: A (After) B (Before) C (Copy) D (Delete) I (Insert)
M (Move) S (Save)
CMD USERID NETNAME TERM TRAN PROGRAM TRAP ABEND
IF ...................... TRAP CONDITION .......................
----------------------------------------------------------------------
_ ******** ACME0027 0027 **** ******** YES
IF
_ ________ ________ ____ ____ ________ ___
IFTo create an enhanced trap on MQ message data, overtype ACME0027 in the NETNAME field and 0027 in the TERM field with all asterisks (*), type CSQ4CVB1 in the PROGRAM field, type MQD(1:7)=T'1234567' in the trap condition field on the second line of the trap entry following the word IF, and press Enter.
Enhanced Trap for MQ Message Data----------------------------------- TRAP SUMMARY (1.6) --------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CSQ4CVB1 CSECT: CSQ4CVB1 COMPILED: 28 JUN 2002 - 15.00.43
MODE: TERM (IP TERM or ALL) NO IP TRAPS ENTRY 000001
LINE COMMANDS: A (After) B (Before) C (Copy) D (Delete) I (Insert)
M (Move) S (Save)
CMD USERID NETNAME TERM TRAN PROGRAM TRAP ABEND
IF ...................... TRAP CONDITION .......................
----------------------------------------------------------------------
_ ******** ******** **** **** CSQ4CVB1 YES
IF MQD(1:7) = T'1234567'
_ ________ ________ ____ ____ ________ ___
IFThis enhanced trap causes Code Debug to take breakpoints and trap abends only when the MQ message data has a value of 1234567 for the seven characters starting at position 1.
The literal T'1234567' could also have been entered as '1234567' without the preceding type specification of T.
This type of trap is useful for enabling enhanced breakpoints in programs for non-terminal tasks. The transaction that initiates CSQ4CVB1 can be started from any platform anywhere on the network, and Code Debug will pause execution at the breakpoint if the specified MQ message data condition is met.End your debugging session by typing XPND on a blank CICS screen and pressing Enter.