Starting Code Debug TSO Db2 stored procedure debugging session using Batch Connect
Code Debug TSO consists of specific menus and screens accessed through ISPF. During your debugging session, Code Debug TSO screens are viewed on a TSO terminal.
Before starting the session, prepare your programs (precompile, compile, and link edit) with the Common Shared Services (CSS) language processor. You can use the Code Debug TSO online facilities to prepare your programs. See Preparing Your Programs for additional information. For more information about Common Shared Services, see the Common Shared Services User/Reference Guide.
Once you have a valid load module and DDIO data set for the stored procedure, log on to TSO and invoke Code Debug TSO. Use the procedures that are in effect at your site. These procedures will include the following steps:
From the Code Debug TSO Primary Menu (See the following figure), select option 4 (Stored Procedures) and press Enter.
Code Debug TSO Primary Menu----------- BMC AMI DevX Code Debug for TSO 17.02 - PRIMARY MENU ------------
OPTION ===>
0 DEFAULTS - Specify defaults
1 PREPARE - Prepare programs for debugging
2 TSO - Debug programs interactively under TSO
3 BATCH - Debug programs interactively under batch
4 STORED PROC - Debug DB2 Stored Procedures interactively
5 UTILITIES - Perform utility functions
F FADB2 - Invoke File-AID for DB2
FA FILE-AID - Invoke File-AID for MVS
FI FILE-AID/IMS - Invoke File-AID for IMS
C CODE COVERAGE - Code Coverage Reports and Utilities
T TUTORIAL - Display information about Code Debug TSO
X EXIT - Exit primary menu
Profile ===> DEFAULT - *** NO DESCRIPTION ***
For Online Technical Support Reference: https://support.bmc.com
COPYRIGHT (C) 2016, Compuware Corporation. All rights reserved.
COPYRIGHT (C) 2016, 2020, 2023 BMC Software, Inc. All rights reserved.
(800) 538-7822
Press ENTER to process or enter END command to terminate- On the Process DB2 Stored Procedures screen (Code Debug TSO Process DB2 Stored Procedures Screen), type SETUP on the command line and press Enter to display the Code Debug TSO Setup Menu screen (Code Debug TSO Setup Menu Screen).
Specify an A (All) in the OPTION field of the Setup Menu screen and press Enter to display the Base Product Data sets screen. Continue to press Enter to access additional screens and review all of your setup selections. The following choices are available:
- Load libraries—user program libraries allocated as STEPLIB. Verify that the order of concatenation is correct. Help libraries are also listed on this screen.
- DDIO Data set Files—the library name should be the data set name of the DD CWPDDIO in your Code Debug compile step. The field designations are User Libraries and Installation Libraries.
- Test script libraries.
- Test session log data set.
- Test session script data set.
- Db2 system names and DSNLOAD data sets.
- Code Coverage data sets and session parameters (if installed at your site).
- Test session document data set—used for diagnostic purposes under the direction of Code Debug Technical Support. Disposition after test as D.
- Extended setup options.
- If everything is correct, press PF3 from the Setup Menu to return to the Process DB2 Stored Procedures screen (see Code Debug TSO Process DB2 Stored Procedures Screen).
- Fill in the schema name, the stored procedure name or UDF, Db2 subsystem name, and maximum number of tests for the stored procedure that you wish to debug. The stored procedure name can be a stored procedure, trigger, or UDF. In the case of a UDF, the procedure name should be used in the Stored Procedure Name or UDF field. In the case of triggers, the trigger must use triggered SQL that invokes a stored procedure. So, on the CREATE TRIGGER you should include the SQL that calls the stored procedure.
- Fill in the client end userID, PC account code, or IP address of the computer. You may also enter an asterisk (*) to match on anything.
- Set the User Supplied WLM JCL field to N (No) to make Code Debug retrieve the JCL defined for the stored procedure. Set User Supplied WLM JCL to Y (Yes) if you wish to specify your own JCL to execute the stored procedure. When specifying Y, an additional Select Job Step screen will be displayed where you must enter the data set that contains the JCL. (This JCL must execute the WLM server.)
Convert and Submit the JCL: The Select Job Step screen (Code Debug TSO Select Job Step Screen) is used to specify how you want each job step to execute (in interactive or unattended mode), and if you want Code Coverage to be active or not. When a job step is selected for interactive debugging, the source for that step is displayed at your terminal.
When a step is selected to run in unattended mode, you cannot interact with the step from your terminal. If you want to debug the step, Code Debug debugging commands must be read from a test script and the output results from the test session are written to the session log.
You can submit the job from this screen, or you can edit the JCL. When you submit the job, the Batch Connect JCL scanner automatically converts each step to execute in the specified mode (interactive or unattended).
- Connect to the Job: If you submit the job with the RUN command, you are automatically connected to the job steps that were specified to execute in interactive mode. If you submit the job with the SUBMIT command, you must use either the CONNECT or STATUS command to connect your terminal to the job steps selected for interactive debugging.
- Edit the JCL: Optionally, you can access the Edit Facility from the Process Execute JCL screen or Select Job Step screen to view and confirm the JCL conversion, or to make changes to the JCL.
- Once the debugging session is submitted, Code Debug TSO waits for the stored procedure to be called by the client application. After the stored procedure has been called, you can connect to it with Code Debug TSO.
- View the Code Debug TSO source display on the TSO terminal.
- Debug the stored procedure using any of the Code Debug TSO debugging commands.
- At the end of the test, type GO or EXIT and press Enter. EXIT is a premature end to the test and will cause an abend. Db2 updates may be rolled back during this period.
- If you enter a number greater than 1 in the Maximum Number of Tests field, Code Debug TSO will wait until the next time the stored procedure is called, and then return you again to the source.