COBOL Editing
To invoke the Editor, double-click on the COBOL file you wish to edit, on the top left window - inside the COBOL Explorer.
This will bring the chosen file into the main window.
We will go through editing the COBOL program ZBNKPRT1.cbl. This program is a simple batch program which produces a report from a sequential data file.
Before you start, since we are editing, it is strongly recommended that you make a backup copy of this file. (You will find it inside C:\\MFETDUSER\\BankDemo\\Sources\\cbl).
The default behaviour within Eclipse is that when you save a changed COBOL file, there is an automatic compilation of that file and any other related files.
Since this module is primarily concerned with editing we will turn this Automatic Build off for now. This will mean that there will not be a forced build each time we save the file. Particularly if we edited a copy file this could cause many programs to be recompiled. We should turn it back on again at the end of this editing module.
1. From the Eclipse menu select Project; turn off Build Automatically
2. Inside Eclipse, double click the COBOL program ZBNKPRT1.cbl to see it appear in the main window. (Your colorization may be different to this if you have modified it)
Simple Editing
As with most editors running on a Windows PC the use of the common keys such as cursor right, left, up, down, page-up, page-down, home and end behave exactly as you would expect.
Repeated use of the home and endkeys cause the cursor to move across the various portions of your COBOL program such as columns 1, 7, 8, 72 etc.
The editor can be switched between insert and overstrike mode by pressing the Insert key. The mode, along with the cursor position in the file, is shown at the foot or the Eclipse window.
If you click the cursor on a data item name, you will see that the entire data item name is highlighted along with every other occurrence of that data item name in the program.
insert ==>>>>>
You get the same effect when placing the cursor on a paragraph or section name. This allows you visually see all the places in the program where that item is used.
If this does not work for you, it will be because the Toggle Mark Occurrences button has not been selected.
Colorization
You will see that the COBOL program is colorized in various ways. You can check and modify the existing color settings by selecting Window, Preferences. Then select Micro Focus COBOL, Editor, COBOL Syntax, Color.
For more information refer to Eclipse Properties and Options changes
Copying and Pasting
The standard Windows functions of Cut, Copy and Paste are used in the editor. The keys are:
- Ctrl/C for copy
- Ctrl/X for cut
- Ctrl/V for paste
Also the standard key for undo is Ctrl/Z
Hovering over a data item
Hovering your mouse pointer over a data item, reveals details of that data item definition.
In the above example you can see that WS-EXEC-PARM-DATAis:
- A Working-Storage item
- PIC X(12)
- It is referenced 6 times in the program
- 12 bytes long
Find Data References
To find out all places that a particular data item is used.
1. Click your mouse on the data item you require.
2. Press Ctrl/Shift/G (or right click and select find references) to bring up a list of all the places where that data item is used.
3. Double clicking in the Search list will take you to the relevant place in the editor window
Next: Eclipse Editor Features
#MFDS
#EnterpriseDeveloper
#Eclipse



