Skip to content

Commit 3e80808

Browse files
authored
Merge pull request #174 from openmainframeproject/code4z-update
Signed-off-by: MikeBauerCA <[email protected]>
2 parents d9ce50d + 6769f27 commit 3e80808

File tree

2 files changed

+9
-36
lines changed

2 files changed

+9
-36
lines changed

COBOL Programming Course #1 - Getting Started/COBOL Programming Course #1 - Getting Started.md

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,6 @@ This section introduces the Code4z extension package, in particular the COBOL La
524524
- **Syntax Highlighting and Coloring**
525525
- **Syntax and Semantic Check**
526526
- **Navigation of Code**
527-
- **Breadcrumb View**
528-
- **Outline View**
529-
- **Shortcuts**
530527
- **Go To Definition**
531528
- **Find All References**
532529
- **Copybook Support**
@@ -535,19 +532,19 @@ This section introduces the Code4z extension package, in particular the COBOL La
535532

536533
## What is Code4z?
537534

538-
Code4z is an all-in-one, open-source mainframe extension package for Visual Studio Code. The Code4z package contains extensions which provide language support for COBOL and High Level Assembler language, a debugger for COBOL programs running on a CICS region, as well as tools which enable developers to access mainframe data sets and CA Endevor code repositories using the Visual Studio Code interface. This guide focuses on the COBOL Language Support extension. The Zowe Explorer extension is also included in the Code4z package.
535+
Code4z is an all-in-one, open-source mainframe extension package for Visual Studio Code. The Code4z package contains extensions which provide language support for COBOL and High Level Assembler language, a debugger for COBOL programs, as well as tools which enable developers to access mainframe data sets and CA Endevor code repositories using the Visual Studio Code interface. This guide focuses on the COBOL Language Support extension. The Zowe Explorer extension is also included in the Code4z package.
539536

540537
The COBOL Language Support extension leverages the Language Server Protocol to provide autocomplete, highlighting, and diagnostic features for COBOL code. Together with Zowe Explorer, you can load COBOL code from a mainframe data set, and edit it leveraging the LSP features of the extension. Once you finish editing, you can save the file back on the mainframe, and store a copy locally.
541538

542539
The Code4z Extension Pack can be installed into VS Code by searching the Extensions Marketplace inside VS Code for "Code4z" and selecting install. The extension pack contains a number of extensions that can be leveraged when working with the mainframe, including the COBOL Language Support extension which provides similar functionality to the Z Open Editor extension discussed earlier. Therefore, ensure only one of these two extensions is enabled. Other extensions included in the pack will work with either COBOL Language Support or Z Open Editor. To see more detailed instructions on installing this extension, refer to "Installation of VSCode and Extensions".
543540

544541
## Known File Extensions
545542

546-
Code4z recognises files with the extension .COB and .CBL as COBOL files. This applies to both local files and files held in a PDS on the mainframe. COBOL Language Support features are automatically enabled when you open any file with an extension identifying it as a COBOL file.
543+
Code4z recognizes files with the extensions .COB and .CBL as COBOL files. This applies to both local files and files held in a PDS on the mainframe. COBOL Language Support features are automatically enabled when you open any file with an extension identifying it as a COBOL file.
547544

548545
## Syntax Highlighting and Coloring
549546

550-
The Code4z package enables coloring of keywords, paragraphs, and variables in different colors to make the code easier to navigate.
547+
The COBOL Language Support extension enables coloring of keywords, paragraphs, and variables in different colors to make the code easier to navigate.
551548

552549
## Syntax and Semantic Check
553550

@@ -559,63 +556,39 @@ The COBOL Language Support extension checks for mistakes and errors in COBOL cod
559556

560557
## Navigation of Code
561558

562-
The Code4z package enables several features for ease of navigation through code.
563-
564-
### Breadcrumb View
565-
566-
The breadcrumb view across the top of the editor shows where the current line of code exists within the structure of the COBOL source code. You can click each element on the bar to see that section of the code highlighted, or to select a code element within the section and navigate to it.
567-
568-
![](Images/code4z-img2.png)
569-
570-
*Figure 2. Breadcrumb view.*
571-
572-
### Outline View
573-
574-
The Code4z package enables the outline view tab in the sidebar. Outline view enables you to easily navigate through sections and individual variables and paragraphs.
575-
576-
### Shortcuts
577-
578-
You can use the following shortcuts to navigate through your code:
579-
580-
* **CTRL+ALT+,** moves you one section back.
581-
* **CTRL+ALT+.** moves you one section forward.
582-
* **CTRL+ALT+D** takes you to the data division.
583-
* **CTRL+ALT+P** takes you to the procedure division.
584-
* **CTRL+ALT+W** takes you to the working storage section.
585-
586-
These commands are also available if you right click anywhere in the code.
559+
The COBOL Language Support extension enables several features for ease of navigation through code.
587560

588561
### Go To Definition
589562

590563
While your cursor is placed on a variable or paragraph name, you can press **F12** or **CTRL+click** to use the **Go To Definition** functionality to display the point in the code where the variable or paragraph is defined.
591564

592565
![](Images/code4z-img3.png)
593566

594-
*Figure 3. Go To Definition shows the point at which the USER-STREET variable is first defined.*
567+
*Figure 2. Go To Definition shows the point at which the USER-STREET variable is first defined.*
595568

596569
### Find All References
597570

598571
The **Find All References** functionality (**SHIFT+ALT+F12**) highlights all references to a variable or paragraph and displays them in a list in the sidebar, so that you can easily navigate between them.
599572

600573
![](Images/code4z-img4.png)
601574

602-
*Figure 4. Find All References lists all references to the USER-STREET variable in the code.*
575+
*Figure 3. Find All References lists all references to the USER-STREET variable in the code.*
603576

604577
## Copybook Support
605578

606-
Copybooks are pieces of source code stored in separate data sets which are referenced in a program. The COBOL Language Support extension enables you to download all copybooks referenced in your program from the mainframe to a folder on your machine. In order for this feature to work, you need to set up and configure a Zowe CLI `zosmf` profile.
579+
Copybooks are pieces of source code stored in separate data sets which are referenced in a program. The COBOL Language Support extension enables you to download all copybooks referenced in your program from the mainframe to a folder in your workspace. In order for this feature to work, you need to set up and configure a Zowe CLI `zosmf` profile. You can also enable support for copybooks stored locally in folders in your workspace. This is useful when working with a COBOL project stored in a Github repository.
607580

608581
The COBOL Language Support extension helps to ensure that copybooks called in the code remain compatible through semantic analysis of keywords, variables, and paragraphs within copybooks, and ensures the consistency of code by defining variables and paragraphs across copybooks. The extension also helps to protect against unwanted errors caused by recursive or missing copybooks.
609582

610-
The **Go To Definition** and **Find All References** functionalities are also extended to work for occurrences of variables and paragraphs from copybooks called in the program as well as from the program itself.
583+
The **Go To Definition** and **Find All References** functionalities are extended to work for occurrences of variables and paragraphs from copybooks called in the program as well as from the program itself. You can also use the **Go To Definition** feature on a copybook name in order to open it.
611584

612585
## Autocomplete
613586

614587
The COBOL Language Support extension provides live suggestions while you type for COBOL keywords, as well as variables and paragraphs which are already referenced in the code or in copybooks used by the program.
615588

616589
![](Images/code4z-img5.png)
617590

618-
*Figure 5. Autocomplete lists possible variables and keywords beginning with the typed string in a list.*
591+
*Figure 4. Autocomplete lists possible variables and keywords beginning with the typed string in a list.*
619592

620593
## Summary
621594

Binary file not shown.

0 commit comments

Comments
 (0)