COBOL Language Support
COBOL Language Support enhances the COBOL programming experience on your IDE. The extension leverages the language server protocol to provide autocomplete, syntax highlighting and coloring, and diagnostic features for COBOL code and copybooks. The COBOL Language Support extension can also connect to a mainframe using a Zowe CLI z/OSMF profile to automatically retrieve copybooks used in your programs and store them in your workspace.
COBOL Language Support recognizes files with the extensions
This extension is a part of the Che4z open-source project. Feel free to contribute right here.
COBOL Language Support is also part of Code4z, an all-round package that offers a modern experience for mainframe application developers, including HLASM Language Support, Explorer for Endevor, Zowe Explorer and Debugger for Mainframe extensions.
The COBOL Language Support extension is not compatible with other extensions that provide COBOL support. We recommend that you disable all other COBOL-related extensions to ensure that COBOL Language Support functions correctly.
COBOL Language Support provides the following COBOL syntax awareness features:
Autocomplete speeds up the coding process by intuitively suggesting the most likely variables or paragraphs to follow existing code. The extension provides live suggestions while you type for:
Syntax and Semantic Check for Code
This feature checks for mistakes and errors in COBOL code. The syntax check feature reviews the whole content of the code and suggests fixes, through syntax and semantic analysis which returns diagnostics on the entire context of the code, not just keywords.
The extension enables syntax highlighting for COBOL code.
Contrasting colors are used in displayed code for ease of identifying and distinguishing keywords, variables, and paragraphs.
The COBOL Language Support extension supports copybooks used in your source code that are stored in a local folder in your workspace. If your copybooks are stored in mainframe data sets, you can use a Zowe CLI z/OSMF profile to automatically download them from the mainframe to your workspace.
You can use copybooks stored in local folders, mainframe data sets or both. To enable copybook support, you specify the folders and data sets that contain copybooks used in your project in the workspace settings. When a copybook is used in the program, the folders and data sets are searched in the order they are listed for files and members that match the copybook's name. If a copybook with the same file name is located in both a local folder and a mainframe data set, the one in the local folder is used.
Copybook support features are disabled for files stored in the folder .c4z/.extsrcs in your workspace. If you also use the Debugger for Mainframe extension to debug your COBOL programs, you might have some files stored in this folder.
Storing Copybooks Locally
You can store your copybooks locally in folders in your workspace and specify those folder paths in your workspace extension settings. Ensure that the file names of your locally stored copybooks are in upper case, for example
Follow these steps:
Retrieving Copybooks from the Mainframe
You can also set up automatic copybook retrieval from the mainframe to download copybooks from mainframe data sets to your workspace.
Follow these steps:
Copybooks that you retrieve from mainframe data sets are stored in the .c4z/.copybooks directory within the workspace, which is created automatically.
Because copybooks that are downloaded to the .copybooks folder might change on the mainframe, we recommend that you refresh your copybooks from time to time. To refresh your copybooks, manually delete the .copybooks folder in your workspace. The copybooks are then re-downloaded from the mainframe the next time you open a file that references each copybook.
Copybooks downloaded from the mainframe using an older version of COBOL Language Support might also be found in a .copybooks directory in the workspace root. We recommend that you delete this folder so that all files are downloaded again to the .c4z/.copybooks folder.
Copybook Support Features
The extension includes the following copybook support features: