You are going to explore some of the COBOL editing features using the ZBNKPRT1.cbl program which produces a report from a sequential data file.
This opens the file in the COBOL editor in Visual Studio.
This expands the copybook directly in the code of ZBNKPRT1.cbl.
This automatically outputs messages in the Error List window about problems that occurred in the code. You can sort the list by file name. Double-clicking the line for an error in the Error List window positions you on the line in the copybook in the expanded view which causes the error.
The changes you made to the expanded view were applied to the source of the copybook so now you are prompted to save the file - click No.
If this window is closed, you can open it from
.
This provides you with details of the location, the size, the format, and the number of times the field is used in the program.
This positions the cursor on the line of code where the data item is defined.
This opens the Find Symbol Results window with a list of all occurrences of the data item in the code.
The results are displayed in the Find Results 1 window.
This highlights all occurrences of the variable in the editor and opens the Rename widget. Note that any changes you make are applied the current project. Set Scope to Current COBOL Program.
Check Preview changes.
This opens the Preview Changes - Rename dialog box showing which files and instances of the variable will be renamed.
All instances of the data item are renamed in the current program.
MOVE W TO
Notice how the words you type change in the editor. Once a word is recognized as a reserved word or a data item, its color changes. If a line of code contains invalid COBOL syntax, the word that is not recognized is underlined with a wavy red line. You can check the Error List window to see what errors are reported.
MOVE 34 TO WS-
You can now remove the line numbers from your code - note that the Renumber and Unnumber commands are not available in the expanded copybook view.
This removes the line numbers from the COBOL sequence area.
To reinsert the line numbers in your code:
To insert line numbers beyond the end of area B:
You should now see line numbers running down both sides of the source code:
The editor lets you edit JCL files in text view and offers a basic level of colorization for items such as reserved words and comments. The JCL editor does not support background parsing or syntax checking.
There are two ways to edit BMS files. The first one is to use the basic BMS text editor available in the IDE. The other is to use a WYSIWYG version, the Micro Focus BMS Painter, which is available as a separate utility installed with this product.
To open the BMS file in the IDE text view:
Although you can use this basic text editor to make small changes, it is quite difficult to edit BMS files in text view.
A much more suitable and less error-prone way to edit BMS files is to use the BMS Painter.
This starts the external Micro Focus BMS Painter.
For example, double-click the data field immediately following the text “User Id” and move it to a different position on the map.
For example, do this for the MBANK10 mapset and the BANK10A map.
You can edit data files using one of two available Micro Focus Data File Editor tools.
By default, Visual Studio is configured to use the new Data File Tools utility. To check where this is enabled:
To edit the .dat file:
This starts the Data File Editor and loads the .dat file in the Open Data File dialog box.
This highlights the record.