Example: using CEETEST to start z/OS Debugger from PL/I

The following examples show how to use the Language Environment® callable service CEETEST to start z/OS® Debugger from PL/I programs.
Example 1
No command string is passed to z/OS Debugger at its invocation and no 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.
CALL  CEETEST(*,*);    ⁄*  omit arguments   *⁄
Example 2
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 executes the command string. Barring any further interruptions, the program runs to completion, where z/OS Debugger prompts for further commands.
DCL   ch  char(50)
      init('AT STATEMENT 10 DO; LIST(x); LIST(y); END; GO;');

DCL   1  fb,
         5  Severity  Fixed bin(15),
         5  MsgNo     Fixed bin(15),
         5  flags,
            8  Case   bit(2),
            8  Sev    bit(3),
            8  Ctrl   bit(3),
         5  FacID     Char(3),
         5  I_S_info  Fixed bin(31);


DCL   CEETEST  ENTRY  ( CHAR(*)  VAR  OPTIONAL,
         1   optional ,
           254 real fixed bin(15),     ⁄* MsgSev     *⁄
           254 real fixed bin(15),     ⁄* MSGNUM     *⁄
           254                         ⁄* Flags      *⁄,
             255 bit(2),               ⁄* Flags_Case     *⁄
             255 bit(3),               ⁄* Flags_Severity *⁄
             255 bit(3),               ⁄* Flags_Control  *⁄
           254 char(3),                ⁄* Facility_ID    *⁄
           254 fixed bin(31) )         ⁄* I_S_Info    *⁄
                 options(assembler) ;

CALL  CEETEST(ch, fb);
Example 3
This example assumes that you use predefined function prototypes and macros by including CEEIBMAW, and predefined feedback code constants and macros by including CEEIBMCT.

A command string is passed to z/OS Debugger that sets a breakpoint on every tenth executed statement. Once a breakpoint is reached, z/OS Debugger displays the current location information and continues the execution. After the CEETEST call, the feedback code is checked for proper execution.

Note: The feedback code returned is either CEE000 or CEE2F2. There is no way to check the result of the execution of the command passed.
%INCLUDE CEEIBMAW;
%INCLUDE CEEIBMCT;
DCL 01 FC FEEDBACK;

⁄* if CEEIBMCT is NOT included, the following DECLARES need to be
   provided:          ---------- comment start -------------

Declare CEEIBMCT  Character(8) Based;
Declare ADDR      Builtin;
%DCL FBCHECK ENTRY;
%FBCHECK:  PROC( fbtoken, condition ) RETURNS( CHAR );
   DECLARE
      fbtoken    CHAR;
      condition  CHAR;
RETURN('(ADDR('||fbtoken||')–>CEEIBMCT = '||condition||')');
%END FBCHECK;
%ACT FBCHECK;
                      ---------- comment end --------------- *⁄

Call CEETEST('AT Every 10 STATEMENT * Do; Q Loc; Go; End;'||
             'List AT;', FC);

If ¬FBCHECK(FC, CEE000)
   Then Put Skip List('––––> ERROR! in CEETEST call', FC.MsgNo);