Example: using CEETEST to start z/OS Debugger from COBOL

The following examples show how to use the Language Environment® callable service CEETEST to start z/OS® Debugger from COBOL programs.
Example 1
A command string is passed to z/OS Debugger at its invocation and the feedback code is returned. After it gains control, z/OS Debugger becomes active and prompts you for commands or reads them from a commands file.
 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.
77  Debugger                PIC x(7)  Value 'CEETEST'.

01  Parms.
    05  AA                  PIC S9(4) BINARY   Value 14.
    05  BB                  PIC x(14)   Value 'SET SCREEN ON;'.

CALL Debugger USING Parms FC.
Example 2
A string of commands is passed to z/OS Debugger when it is started. After it gains control, z/OS Debugger sets a breakpoint at statement 23, runs the LIST commands and returns control to the program by running the GO command. The command string is already defined and assigned to the variable COMMAND-STRING by the following declaration in the DATA DIVISION of your program:
01 COMMAND-STRING.
   05 AA     PIC 99    Value 60 USAGE IS COMPUTATIONAL.
   05 BB     PIC x(60) Value 'AT STATEMENT 23; LIST (x); LIST (y); GO;'.
The result of the call is returned in the feedback code, using a variable defined as:
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.
in the DATA DIVISION of your program. You are not prompted for commands.
CALL "CEETEST" USING COMMAND-STRING FC.