Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>HB.js for VS CodeNew to Visual Studio Code? Get it now.
HB.js for VS Code

HB.js for VS Code

Broadcom

broadcom.com
|
361 installs
| (0) | Free
Code4z extension that enables using HB.js in VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code4z OpenIssues

HB.js for VS Code

The HB.js for VS Code extension modernizes the way you interact with HostBridge JavaScript Engine (HB.js) and offers a friendly and convenient way to work with HB.js. The HB.js for VS Code extension includes the following features:

  • Using HB.js Commands (Make/Put/Run)
  • Native generation of a JavaScript object from a COBOL copybook and from an OpenAPI file
  • Access to the Application Explorer (AE) and the AE Playback
  • Generating and running automated tests

Business value:

  • Accelerated Mainframe Modernization: Empowers developers to rapidly transform complex CICS transactions into reusable REST/JSON APIs without requiring changes to underlying COBOL code or relying on screen-scraping.

  • Enhanced Developer Productivity and Agility: Modernizes the mainframe experience by bringing HB.js features directly into VS Code, eliminating the need for traditional "green screen" navigation.

  • Reduced Quality Assurance Cycle Times: Automatically generates 3270 testing APIs to enable shift-left testing, allowing teams to validate mainframe logic early in the development cycle and replace slow, manual terminal testing with high-speed automated suites.

This extension is part of the Code4z experience

HB.js for VS Code is part of the Code4z experience from Broadcom, which offers a modern experience for mainframe application developers. To get started with Code4z, check out our foundational extension pack.


We encourage you to share ideas to help improve the HB.js for VS Code Extension. You can also report extension issues, using the following link.

Share an idea or open an issue in our Git repository.

Address Software Requirements

Before you use the HB.js for VS Code extension, ensure that you meet the following requirements:

Server

  • HB.js installed on the mainframe
  • A valid mainframe user ID
Getting Started
Specify a VS Code Workspace

The HB.js extension requires a VS Code Workspace for full functionality. To associate a folder with a workspace, open a folder in the Explorer view.

Specify a Workspace

Add a Host Connection

To add a new host connection, select the + (plus) icon in the HB.JS: HOSTS view and enter the following information:

  1. The HB.js Host URL, including the port number, and press Enter. For example: http://example.com:9000

The CICS systems programmer responsible for the CICS regions can provide the host URL, including the port number.

  1. A Host Name and a Region Name to identify the connection in the HB.JS: HOSTS view. These names are labels only, so they can be anything; the URL specifies the connection information.
  2. A Default User ID, which is a user ID that is already defined in CICS on the host. When you connect to the host, you are prompted to enter the password for this user ID.
  3. Select Add Host.

Add New Host Connection

Select a Default Repository

In the HB.JS HOSTS view, select a host and a region, right-click the chosen region, and select Set Default Repository.

Set Default Repository

Use HB.js Commands
  1. Navigate to the HBJS Terminal panel, which shows HB.js command output and messages.
  2. To open a file in the HB.JS: HOSTS view, right-click the file and select Get or double-click a Host file.
  3. Right-click in the editor and select HB.js Commands > (Make|Put|Run).

Execute Primitive

Use the Application Explorer to Examine CICS Applications
Access the Application Explorer

To access the Application Explorer, perform the following steps:

  1. Select the Application Explorer icon for the region where you want to run the Application Explorer.
  2. In the App Explorer tab, enter the CICS transaction ID for the initial transaction to analyze, and then press Enter.

For information about using the Application Explorer, see Analyze Applications in the HB.js documentation.

![Application Explorer](https://broadcommfd.github.io/hbjs-vscode-extension/GIFs/AccessAE251208.gif)
Access the Application Explorer Settings

To access the settings for the Application Explorer, perform the following steps:

  1. Select the Application Explorer Settings icon for a region.
  2. Enter your values and then select Submit to save your settings for the selected region.

For information about the Application Explorer settings, see Use the Application Explorer in the HB.js documentation.

Application Explorer Settings

Save an Application Explorer Session to a JSON File
  1. In the Application Explorer, navigate to an active terminal session.
  2. Close the App Explorer tab and select Save in the pop-up window.
  3. The saved session is stored in the Explorer view under your workspace as App Explorer Playback > [today's date] > filename.json.

Execute Primitive

Open an Application Explorer Playback Session from a JSON File
  1. In the Explorer view, navigate to the saved JSON file.

Note: If you do not have a saved JSON file, see the preceding section, Save an Application Explorer Session to a JSON File. 2. Right-click on the file and select HB.js Commands > Application Explorer Playback. An Application Explorer Playback tab opens. 3. You can access screens directly in the playback by selecting the screen icons.

To progress through the screens sequentially, use the Page Up and Page Down keys.

For information about the Application Explorer settings, see Save an Application Explorer Session in the HB.js documentation.

![Execute Primitive](https://broadcommfd.github.io/hbjs-vscode-extension/GIFs/accessPlayback251208.gif)
Generate JavaScript Objects
Generate a JavaScript Object from a COBOL Copybook
  1. Right-click on a COBOL file in the editor or explorer view and select HB.js Commands > Generate JS Object.

Note: You can select either COBOL field names to use COBOL-style field names or JavaScript field names to use JavaScript-style field names in the generated file.

The generated HB.js JavaScript object is opened in the editor and is saved to the workspace folder using a filename similar to filename_(COBOL|JavaScript)_JSOBJ.hbx.

- filename is the name of the original COBOL file
- (COBOL | JavaScript) indicates whether the HB.js function is created using COBOL-style or JavaScript-style field names for the object.

  1. Select HB.js Commands > Make to store the file in the utility repository on the connected mainframe region.
  2. Add the following code to your HB.js scripts to access the newly created JavaScript object.

Note: Be sure to replace filename and utility repository in the require statement with actual values.

//COBOL Copybook Utilities
var copybookFactory = require('[filename_(COBOL|JavaScript)_JSOBJ]', '[utility repository]');

var demoCopybook = new copybookFactory.commareaBuffer();
var pgm = new CommareaProgram();

//Initialize
demoCopybook.initialize();
pgm.program = 'TRADERBL';

//Commands 
demoCopybook.get()
demoCopybook.set()
pgm.run(demoCopybook.buffer);

JS Object Generation

Generate a JavaScript Object from an OpenAPI JSON File
  1. In the editor, right-click on an OpenAPI JSON file and select HB.js Commands > Generate JS Object from OpenAPI.

Note: Not all formats are supported at this time. Any unsupported formats are flagged as failed tests.

The generated HB.js JavaScript object is opened in the editor and is saved to the workspace folder using a filename similar to filename_OpenAPI_JSOBJ.hbx.

filename is the name of the original OpenAPI JSON file.

  1. Right-click on the file and select HB.js Commands > Make to store the file in the utility repository on the connected mainframe region.
  2. Add the following code to your HB.js scripts to access the newly created JavaScript object.

Note: Be sure to replace filename and utility repository in the require statement with actual values.

//OpenAPI Utility
var openAPIUtil = require('filename_OpenAPI_JSOBJ', '[utility repository]');

//Retrieve the required schema from your utility file 
var openAPIDefinition = new openAPIUtil.filename();
var openAPISchema = openAPIDefinition.['your files dot notation'].schema;

//Set your object or array of objects that you want to validate against your schema
var sampleData = "your object or array of objects here"; 

//Call the validate function from your generated JS Object 
//This example will write out the output 
writeln (JSON.stringify(openAPIUtil.validate(sampleData, openAPISchema)));

//Sample Output 
  //Pass
  {
    "pass": {
      "type": {
        "message": {
          "expected": "string",
          "found": "string"
        }
      }
    },
    "fail": {},
    "summary": "1 validations have passed, 0 failed"
  }
  //Fail
  {
    "pass": {},
    "fail": {
      "type": {
        "message": {
          "expected": "string",
          "found": "object"
        }
      }
    },
    "summary": "0 validations have passed, 1 failed"
  }

Open API JS Object Generation

Generate and Run Automated Tests
  1. Open an Application Explorer Playback session.

  2. In the upper-left of the playback view, select Test Mode.

  3. Add fields to test from one or more application screens:

    a. On a screen to test, select Field on Screen > Named Fields.

    b. Right-click on the name of the field to text and select Toggle Static to add the field to the test script.

    Test scripts populate in the Tests by Screen drop-down to the right of each screen that has tests.

  4. To generate all of the tests in a single test script, select Export Tests in the upper-left of the playback view.

  5. Select Save in the pop-up window to confirm creation of the test script.

  6. The test script should open in the editor. If it does not open automatically, open the file saved under App Explorer Test Files > [today’s date].

  7. To run the test script, right-click HB.js Commands > Run.

Note: If your Application Explorer Playback captures the exit of a host application, be sure that all screens where you have selected fields for testing have an active host connection. For information about generating and running automated tests, see Generate and Run Automated Tests in the HB.js documentation. 8. The output of the test results is displayed in the HBJS Terminal panel.

When you close the recorded session, you have the option to save the selected tests as part of the recording. If you save the tests, they show up when you open the saved session and activate Test Mode in the upper-left of the playback view.

Execute Primitive

List of Limitations

The following features exist in the HB.js for Eclipse plug-in that are not available in this extension.

  • Hex dump view
  • Worklog view
Technical Assistance and Support for HB.js

The HB.js 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 HostBridge JavaScript Engine, 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:

  • Telephone and online access to technical support
  • Ability to submit new incidents 24x7x365
  • 24x7x365 continuous support for Severity 1 incidents
  • 24x7x365 access to Broadcom Support
  • Interactive remote diagnostic support
  • Technical support cases must be submitted to Broadcom in accordance with guidance provided in “Working with Support”.

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.


Copyright © 2026 Broadcom. The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.

Privacy Notice

The extensions for Visual Studio Code developed by Broadcom Inc., including its corporate affiliates and subsidiaries, ("Broadcom") are provided free of charge, but in order to better understand and meet its users’ needs, Broadcom may collect, use, analyze and retain anonymous users’ metadata and interaction data, (collectively, “Usage Data”) and aggregate such Usage Data with similar Usage Data of other Broadcom customers. Please find more detailed information in License and Service Terms & Repository.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft