The Rocket Enterprise extension supports COBOL notebooks, which have the file extension .cblnb. COBOL notebooks enable you to write executable COBOL code cells and Markdown cells in one document. Notebooks can compile either as native COBOL or as .NET COBOL code. You can configure certain settings to apply to individual cells or to the notebook as a whole.
In Visual Studio Code:
to create a new file. When naming the file, add the
.cblnb extension and the editor will change accordingly to show the layout for a blank COBOL notebook.
To add a cell to a COBOL notebook:
at the top-left of the notebook or in the center of the editor to add a COBOL code cell.
at the top-left of the notebook or in the center of the editor to add a Markdown cell.
The cell type is labelled in the bottom right corner of each cell. Markdown cells are blank, whereas code cells contain the four division lines characteristic of COBOL programs.
To add a compiler directive on a notebook level:
.
in the notebook toolbar to remove a directive from the drop-down list.
.
in the cell to remove a directive from the
Select directive(s) to delete drop-down list.
If you have a licensed Enterprise Developer product release 9.0 or later, you will have access to the following COBOL Language Server functionality within notebooks:
There are multiple ways to execute a cell. You have the option of running all cells within a notebook or running individual cells.
to run to the left of a code cell to run it.
in the notebook toolbar to run all cells in a notebook.
The output of a code cell is shown directly below the cell.
COBOL notebooks can compile native and .NET COBOL. By default, the code type is set to native. To change to .NET COBOL:
at the bottom of an individual code cell, or click
Cell type for run/debug
in the notebook toolbar to set all code cells.
This opens the drop-down list at the top of the editor.
Debugging a COBOL notebook follows the same procedures as debugging a COBOL program in Visual Studio Code. For more information on debugging, see the Debugging section.
This opens the Debug widget, which enables you to step into and through your code.
to open the
Run and Debug view. The breakpoint information is visible in the
Breakpoints panel.
You can manipulate cells by clicking
More Actions
in the top right corner of a cell. Additional commands available for COBOL notebooks include:
if you are required to enter a value when running a code cell, and type the value in the
Provide Input box. Use this as an alternative to the
Add ACCEPT Value option.