Home

Awesome

<div id="header" align="center">

GitHub issues slack

</div>

Debugger for Mainframe

Debugger for Mainframe provides a debugging interface for InterTest™ for CICS and InterTest™ Batch. This extension provides a modern debugging experience for CICS and Batch programs written in COBOL and High-Level Assembler Language (HLASM).

How can we improve Debugger for Mainframe? Let us know on our Git repository

Debugger for Mainframe is part of Code4z, an all-round VS Code extension package that offers a modern experience for mainframe application developers, including tools for language support, data editing, testing, and source code management. For an interactive overview of Code4z, see the Code4z Developer Cockpit.

Compatibility

Debugger for Mainframe is supported on Visual Studio Code and Github Codespaces.

<a href="https://www.openmainframeproject.org/all-projects/zowe/conformance"><img alt="This extension is Zowe v2 conformant" src="https://artwork.openmainframeproject.org/other/zowe-conformant/zowev2/explorer/color/zowe-conformant-zowev2-explorer-color.png" width=20% height=20% /></a>

Prerequisites

Server

For information on the Testing Tools server and API Mediation Layer, see the InterTest documentation.

Client

Secure Connection

IDE

Debugger for Mainframe is supported on Visual Studio Code version 1.67.0 and above.

Integrate with Zowe Explorer

You can integrate Debugger for Mainframe with Zowe Explorer and set up a Zowe profile to access mainframe data sets and track the status of JCL jobs in connection with your debugging sessions. You can also use Zowe Explorer to submit JCL or to edit your converted JCL before running batch debugging sessions.

To enable job status messages, a Zowe profile name must be specified in your configuration file (see the Add Configuration section below).

Zowe Explorer is available as part of the Code4z package.

Getting Started

Debugger for Mainframe includes two walkthroughs to help you become acquainted with key features of the extension. To access the walkthroughs, select Welcome from the Help menu, and select from the options under Walkthroughs - More...

The buttons in these walkthroughs run commands which can otherwise be found in the F1 menu.

Get Started with CICS Debugging

The Get Started with CICS Debugging walkthrough guides you through the steps required to set up and run a basic CICS debugging session. If you do not have a CICS program to run, you can use the Basic COBOL Demo Session which comes shipped with InterTest for CICS.

For more information about the Basic COBOL Demo Session, see the InterTest and SymDump documentation.

See this video for a step-by-step walkthrough of CICS debugging using Debugger for Mainframe.

Basic Batch Demo Session

The Basic Batch Demo Session walkthrough guides you through the Basic Batch Link Demo which comes shipped with InterTest Batch. For more information about the Basic Batch Link Demo, see the InterTest and SymDump documentation.

The demo program, CAMRCOBB, is in the data set CAI.CAVHSAMP. Note that CAI is the default high-level qualifier, and it can be changed during installation, so on your instance of InterTest the HLQ might be different.

Before you run the Basic Batch Demo Session on Debugger for Mainframe, complete the following tasks:

  1. Allocate a PROTSYM.
  2. Allocate a LOADLIB.
  3. Compile CAMRCOBB and link it to the PROTSYM and LOADLIB.
  4. Locate the step in the demo JCL that runs CAMRCOBB and change the STEPLIB to refer to your LOADLIB. The demo JCL can be found in CAVHJCL(DEMOJCL).

Basic Batch Demo Configuration

During the demo session, you are instructed to fill in a launch.json file with details of your Testing Tools Server and the program that you want to run. Ensure that you add the following parameter, which is not included by default, between "interTestSecure" and "convertedJCL":

"originalJCL": {
                "inDSN": "",
                "stepName": ""
            },

If you connect to InterTest through an Zowe API Mediation Layer gateway, add the line "APIMLServiceID": "", below the "port" parameter.

After you add these optional parameters, the full empty configuration displays as follows:

{
            "name": "Debugger for Mainframe: INTERTEST™ FOR BATCH",
            "type": "intertest-batch",
            "request": "launch",
            "programName": [
                "PROGNAME"
            ],
            "protsym": [
                "PROTSYM"
            ],
            "host": "HOST",
            "port": 0,
            "APIMLServiceID": "",
            "interTestUserName": "USER",
            "interTestSecure": true,
            "originalJCL": {
                "inDSN": "",
                "stepName": ""
            },
            "convertedJCL": ""
        }

Populate the fields as follows:

Using Debugger for Mainframe

To debug CICS and Batch programs with Debugger for Mainframe you open the workspace in your IDE and configure your connection to InterTest using the file launch.json.

Debugged files are temporarily saved in the workspace within the /.c4z/.extsrcs folder.

To debug Batch programs, you also convert the JCL of your program into a new file which is used for debugging.

Create a Configuration File

To start debugging programs in your IDE, you first create a launch.json file within your workspace.

Follow these steps:

  1. Select the Explorer icon in your IDE and open a folder.

    • The workspace opens.
  2. Select the Bug icon to open Debug view.

  3. In the sidebar, click create a launch.json file.
    A list of configurations displays.

  4. Select either Debugger for Mainframe: INTERTEST™ FOR CICS or Debugger for Mainframe: INTERTEST™ BATCH

  5. Fill in the necessary fields as described in the Add Configuration section below.

Add Configuration

The launch.json file contains configurations for debugging different types of programs. The configurations supported by Debugger for Mainframe are:

When you create a launch.json file for the first time, a configuration is added. Click the Add configuration button in the configuration drop-down list to add further configurations.

Basic CICS Configuration

To add a basic CICS configuration, do the following:

  1. Open your launch.json file.
  2. Click the Add configuration... button in the bottom-right corner of the tab.
  3. Select Debugger for Mainframe: INTERTEST™ FOR CICS.
  4. Populate the following fields:
  1. Follow the steps in Run a Debug Session to start your debug session.

Basic Batch Configuration

To add a basic configuration to debug a batch application, do the following:

  1. Open your launch.json file.
  2. Click the Add configuration... button in the bottom-right corner of the tab.
  3. Select Debugger for Mainframe: INTERTEST™ FOR BATCH.
  4. Populate the following fields:
  1. Follow the steps in Run a Debug Session to start your debug session.

Enable the Batch Link Queue

Enable the Batch Link Queue to add the Suspend and Attach functionalities to your Batch debugging experience. These functionalities allow you to suspend and later resume a debugging session, for example:

To enable the Batch Link Queue you add a new configuration to your existing launch.json file, which must already contain at least one intertest-batch configuration.

  1. Open your launch.json file.
  2. Click the Add configuration... button in the bottom-right corner of the tab.
  3. Select Debugger for Mainframe: INTERTEST™ FOR BATCH - Attach.
  4. Populate the following fields:

Dynamic Symbolic Support

If you have integrated InterTest with Endevor on the backend, you can activate the dynamic symbolic support feature to dynamically load symbolic data into a PROTSYM. To enable dynamic symbolic support, specify a PROTSYM in the "DSS" parameter of a batch launch or attach configuration. This PROTSYM is searched along with the other PROTSYMs that you specify in the "protsym" array.

For more information about dynamic symbolic support, see the InterTest and SymDump documentation.

Run a Debug Session

After you define your configuration in launch.json, you can run your debug session in the debugging interface.

  1. Open the Run and Debug panel.

  2. (Batch only, optional) To convert your JCL, press F1 to open the command pallet and run the command Batch: Convert JCL. Complete this step when debugging a program for the first time, or if your program changed since the last debug session.

  3. Press F1 to open the command pallet and run the command Fetch Extended Sources.

  4. If you have more than one Debugger for Mainframe configuration defined in launch.json, a list of available configurations displays. Select the name of the configuration that you want to use to fetch your source.

  5. Enter your mainframe password.

    • The expanded source is displayed.
  6. Set breakpoints as required. You can set breakpoints before you start the debugging process or as the process is running.

  7. Set logpoints as required. Logpoints can be used to highlight an issue within the program while it is running, however logpoints do not cause the program to terminate.

  8. Click the play icon in the top left of the interface to start the debugging process.

  9. (CICS only) Run your program in your CICS region.

You have successfully initiated a debugging session.

Run a Debug Session From the Batch Link Queue

To run a debug session from the Batch Link Queue, ensure that you have an attach configuration in your launch.json file (see Enable the Batch Link Queue for more information.)

  1. Select an attach configuration from the list of configurations on the Run and Debug panel.
  2. Enter your mainframe password
  3. Select the session that you want to resume from the drop-down list The listing is downloaded and the debugging session starts.

When you run a debug session using an attach configuration, the Suspend button is shown by default in the Debug Toolbar. Use the drop-down arrow to switch to the Stop button.

When you suspend a debug session, breakpoints that you define in Visual Studio Code are saved with the session. If you load a debug session from the Batch Link Queue that has breakpoints saved, these breakpoints override ones that are defined locally on the same lines.

Manage the Batch Link Schedule Table

You can use Debugger for Mainframe to manage the Batch Link Schedule Table, which enables you to debug DB2 Stored Procedures and IMS DC applications.

To manage your Batch Link Schedule Table, ensure that you have a batch launch or attach configuration containing your Testing Tools Server host and port and your mainframe username. You can leave the programName and protsym fields in this configuration at their default values.

Schedule a DB2 Stored Procedure or IMS DC Application

To debug a DB2 stored procedure or an IMS DC application, you add the appropriate criteria to the Batch Link Schedule Table, from which you can later run it from the Batch Link Queue using an attach configuration.

  1. Open the F1 menu and select Batch: Show Schedule Table
  2. Select your batch configuration.
  3. Enter your mainframe password and press enter.
    The Batch Link Schedule Table displays.
  4. Select Add New Schedule Entry.
  5. Select either DB2 or IMS.
  6. (Optional) Specify a name for your job and press enter.
  7. Specify your program name and press enter.
  8. (IMS only, optional) Specify an IMS transaction ID for the schedule entry and press enter. If you leave this prompt blank, all transactions are processed. This field can be wildcarded and cannot contain more than eight characters.
  9. (IMS only, optional) Specify an IMS user ID for the schedule entry and press enter. This field can be wildcarded and cannot contain more than eight characters.
    The Is this a one-time entry? prompt displays.
  10. Select Yes or No. If you select Yes, the session is deleted from the Batch Link Schedule Table after it is attached to the Batch Link Queue.
    The stored procedure is scheduled. To view it in the Batch Link Schedule Table, repeat steps 1 to 3 above.

Delete a Batch Link Schedule Table Entry

  1. Open the F1 menu and select Batch: Show Schedule Table
  2. Select your batch configuration.
  3. Enter your mainframe password and press enter.
    The Batch Link Schedule Table displays.
  4. Select the delete icon next to the procedure that you want to delete.
  5. When prompted select Yes to confirm the deletion. The entry is deleted.

Variables Tree View

Use the VS Code variables tree view to view and edit the value of variables during your debugging session. As well as the regular VS Code functionality, Debugger for Mainframe also enables you to edit the hexadecimal value of a variable.

Variables in the tree view are sorted under the following categories:

Filter Variables

To find a variable in the variables tree view, click the Filter icon and type a search string in the text box at the top of the interface. The search returns all variables which contain the provided string. To clear an active filter, click the Filter icon.

The filter searches variable names under the Global and CICS Defined Variables headings only.

Edit the Hexadecimal Value of a Variable

To edit the hexadecimal value of a variable, do the following:

  1. Locate the variable in the variables view.
  2. Right-click the variable and select Set Value.
  3. Enter the hexadecimal value in the format <b>0x<i>value</i></b> and press enter.

You can hover over a variable with an invalid format in the edit window to view the hexadecimal value.

Inline Variables View

Enable inline variables view to see the values of all variables on the highlighted line of code inline.

To enable and disable inline variables view, use the following commands in the debug console:

Call Trace and Statement Trace

Debugger for Mainframe includes tracing features which send information about statements and programs to the left-hand sidebar of your IDE. There are two tracing features, call trace (for CICS programs only) and statement trace (for CICS and Batch programs).

Call trace displays information about calls from program to program, displaying the logical flow between listings. You can view this information in the Call Stack View in the left-hand sidebar of your IDE.

Statement trace displays information about the statements that you pass during your debug session. You can view this information in the Statement Trace View in the left-hand sidebar of your IDE.

You can click on an entry in the Call Stack or Statement Trace View to move the cursor to the relevant line of the source code file.

Records displayed in both views contain the following information:

The call trace and statement trace features are enabled by default. They can be disabled in launch.json before you begin your debug session. For more information, see Add Configuration.

To disable or enable the tracing features during your debug session, use the following commands in the debug console:

Conditional and Unconditional Breakpoints

Breakpoints can be unconditional or conditional. Unconditional breakpoints always stop the process at the specified point until they are removed.

Conditional breakpoints contain specified scenarios which trigger the breakpoint, and are formatted as follows:

leftvalue operator rightvalue
        

Important: Include a space before and after the operator value.

Where:

Correctly defined breakpoints are marked by a red dot.

Incorrectly defined breakpoints are marked by a grey dot or circle, with a summary error message indicating the cause of the error.

You can only use one conditional breakpoint per line.

Data Breakpoints

Data breakpoints are attached to variables and cause the program to stop when the value of the attached variable changes. To set a data breakpoint, right-click a variable in the Variable Tree View and select Break on Value Change.

When you set a data breakpoint in Debugger for Mainframe, a variable-change breakpoint is set on the same variable on the server side. When you set a variable-change breakpoint in InterTest, a data breakpoint is set in Debugger for Mainframe when you load the program listing.

Data breakpoints are valid for one debug session only and must be reset after each use.

Paragraph Breakpoints

Set the launch.json parameter paragraphBreakpoints to "true" to trigger a breakpoint at the beginning of every new paragraph in COBOL code, and every label in Assembler code. For more information, see Add Configuration.

You can also turn this feature on and off in the debugger console by submitting the commands /AT LABEL and /LABEL OFF.

Logpoints

Logpoints mark a particular part of the code, however unlike breakpoints, they do not break or stop the program. Logpoints can highlight an issue within a program while it is running, without causing the program to terminate.

Logpoints can contain text and variables from the code. Enclose the variables in curly brackets without any spaces, as follows:

‘text {variableName} text’

Important: Ensure that the variableName is a single block of text with no spaces and is contained within curly brackets.

The text in the logpoint can be used for detailed observations about the behaviour of the code. The message output from the logpoints is displayed in the debug console.

Logpoints are especially useful as:

Execution Counts

Debugger for Mainframe includes an execution count feature which states how many times each line of code is run between each breakpoint or abend in your debugging session. The execution count feature is only supported for Batch programs.

The execution count feature is disabled by default. It can be enabled in launch.json before you begin your debug session. For more information, see Add Configuration.

To enable or disable the execution count feature during your debug session, use the debug console commands /counts on and /counts off. After you submit the /counts on command, perform an action which progresses the debugging session to display the execution count.

The execution count variable is stored on the mainframe and is only reset when you perform an action which progresses the debugging session. It is not reset by the /counts off command or by closing Visual Studio Code.

Set up Secure Connection

You can use Debugger for Mainframe over a secure connection if your Testing Tools Server instance is configured for a secure connection.

To use Debugger for Mainframe over a secure connection, obtain the server certificate for your Testing Tools Server instance and import it to the trust store of the JRE under which the Debugger for Mainframe DA client is running on your local machine. You can use command line or a UI tool.

Import Server Certificate Using Command Line

Enter the following command: sudo keytool -import -alias hostname -file hostname.cer -storetype JKS -keystore cacerts

Import Server Certificate on a Linux Subsystem

  1. Verify that Java is installed by running the command java -version.
  2. Locate your subsystem's java installation.
  3. Go to /lib/security to find cacerts.
  4. Run the following command to import the certificate: sudo keytool -import -alias hostname -file hostname.cer -storetype JKS -keystore cacerts

Import Server Certificate using a UI

  1. In your preferred UI, locate and open cacerts.
  2. Import the certificate to cacerts.
  3. Name the certificate with an appropriate alias to ensure it is easily identified.
  4. Save your changes.

After you have imported your certificate, run a test debug session with "interTestSecure": true in your launch.json file. If the session fails, ensure that you imported the correct certificate to the correct JRE trust store and try again.

You have configured Debugger for Mainframe to use a secure connection to InterTest.

Troubleshooting

Known Limitations

Enable Troubleshooting Log

To generate a troubleshooting log, add the following parameters to your launch.json file:

Technical Assistance and Support for Debugger for Mainframe

The Debugger for Mainframe extension is made available to customers on the Visual Studio Code Marketplace in accordance with the terms and conditions contained in the provided End-User License Agreement (EULA).

If you are on active support for InterTest, you get technical assistance and support in accordance with the terms, guidelines, details, and parameters that are located within the Broadcom Working with Support guide.

This support generally includes:

Note: To receive technical assistance and support, you must remain compliant with “Working with Support”, be current on all applicable licensing and maintenance requirements, and maintain an environment in which all computer hardware, operating systems, and third party software associated with the affected Broadcom software are on the releases and version levels from the manufacturer that Broadcom designates as compatible with the software. Changes you elect to make to your operating environment could detrimentally affect the performance of Broadcom software and Broadcom shall not be responsible for these effects or any resulting degradation in performance of the Broadcom software. Severity 1 cases must be opened via telephone and elevations of lower severity incidents to Severity 1 status must be requested via telephone.