6RMC CodeWatch UG
6RMC CodeWatch UG
Micro Focus
RM/COBOL
Micro Focus
The Lawn
22-30 Old Bath Road
Newbury, Berkshire RG14 1QN
UK
http://www.microfocus.com
The only warranties for products and services of Micro Focus and its affiliates and licensors (“Micro Focus”) are as
may be set forth in the express warranty statements accompanying such products and services. Nothing herein
should be construed as constituting an additional warranty. Micro Focus shall not be liable for technical or editorial
errors or omissions contained herein. The information contained herein is subject to change without notice.
Contents
Preface ...................................................................................................... 1
Welcome to CodeWatch ............................................................................................................ 1
Prerequisites ............................................................................................................................... 1
About Your Documentation ....................................................................................................... 2
Related Publications................................................................................................................... 3
Symbols and Conventions.......................................................................................................... 3
Technical Support ...................................................................................................................... 5
Support Guidelines .................................................................................................................... 5
Test Cases .................................................................................................................................. 5
List of Figures
Figure 1: Glyphs in Western (ANSI) Character Set in “Courier New” Font ........................ 105
Figure 2: Glyphs in OEM Character Set in “Terminal” Font................................................ 105
List of Tables
Table 1: Types of Workspace Windows ................................................................................. 46
Table 2: Special Characters Allowed in CodeWatch Regular Expressions ............................ 64
Table 3: Direction Keys ........................................................................................................ 117
Table 4: Text Selection Keys ................................................................................................ 120
Table 5: Editing Keys ........................................................................................................... 122
Table 6: Edit Menu Shortcut Keys ........................................................................................ 123
Table 7: RM/COBOL Compile Command Options Available ............................................. 127
Preface
Welcome to CodeWatch
This document describes CodeWatch, Micro Focus’ fully integrated development
environment for RM/COBOL for Windows.
CodeWatch for Windows supports the entire development cycle, including editing, compiling,
and debugging of RM/COBOL applications. CodeWatch can be used to debug and change
programs that are independently compiled, without requiring you to build projects. Instead,
all the knowledge about the structure of your application is built up during debugging
sessions.
The new features for the most recent release of CodeWatch are described in Appendix B:
Summary of Enhancements (on page 135).
Note CodeWatch version 12 is now able to debug service programs running under Micro
Focus’ Xcentrisity Business Information Server (BIS) on Microsoft Windows under Internet
Information Server (IIS). For more information, see the CodeWatch for Xcentrisity Business
Information Server User’s Guide Supplement.
Prerequisites
Several conditions are necessary before you can run CodeWatch for Windows:
• CodeWatch requires that the following products be installed on your system:
− One of the following operating systems is required:
• Microsoft Windows XP
• Microsoft Windows Server 2003
• Microsoft Windows Vista
• Microsoft Windows Server 2008
• Microsoft Windows Server 2008 R2
• Microsoft Windows 7
Related Publications
For additional information, refer to the following publications:
CodeBridge User’s Guide
CodeWatch for Xcentrisity Business Information Server User’s Guide Supplement
RM/COBOL User’s Guide
RM/COBOL Language Reference Manual
RM/COBOL Syntax Summary Help File
WOW Extensions Designer Help File and WOW Extensions Functions and
Messages Help File
Xcentrisity Business Information Server (BIS) User’s Guide
XML Extensions User’s Guide
b. UPPERCASE WORDS indicate items that you enter exactly as shown (although not
necessarily in uppercase).
c. ... indicates indefinite repetition of the last item.
d. | separates alternatives (an either/or choice).
e. [ ] enclose optional items or parameters.
f. { } enclose a set of alternatives, one of which is required.
g. {| |} surround a set of unique alternatives, one or more of which is required, but each
alternative may be specified only once; when multiple alternatives are specified, they
may be specified in any order.
6. All punctuation must appear exactly as shown.
7. Key combinations, sometimes called shortcut keys, are connected by a plus sign (+), for
example, Ctrl+X. This notation indicates that you press and hold down the first key
while you press the second key. For example, “press Ctrl+X” means to press and hold
down the Ctrl key while pressing the X key. Then release both keys.
8. Note the distinction of the following terminology:
• The term “window” refers to a delineated area of the screen, normally smaller than
the full screen.
• The term “Windows” refers to Microsoft 32-bit Windows operating systems,
including Windows 2000, Windows XP, or Windows Server 2003, Windows Vista,
or Windows Server 2008, unless specifically stated otherwise.
Note
RM/COBOL and CodeWatch no longer support earlier Microsoft Windows operating
systems, including Microsoft Windows 98, Windows 98 SE, Windows Me, and
Windows NT 4.0
Furthermore, any references to these versions, or to the shorthand notation “Windows
9x class” or “Windows NT class” that refer to these operating systems, are included for
historical purposes only.
9. RM/COBOL Compile and Runtime Command line options may be preceded by a
hyphen. If any option is preceded by a hyphen, then a leading hyphen must precede all
options. When assigning a value to an option, the equal sign is optional if leading
hyphens are used.
10. In the electronic PDF file, this symbol represents a “note” that allows you to view last-
minute comments about a specific topic on the page in which it occurs. This same
information is also contained in the README file under the section, Documentation
Changes. In Adobe Reader, you can open comments and review their contents, although
you cannot edit the comments. Notes do not print directly from the comment that they
annotate. You may, however, copy and paste the comment text into another application,
such as Microsoft Word, if you wish.
To review notes, do one of the following:
• To view a note, position the mouse over the note icon until the note description pops
up.
• To open a note, double-click the note icon.
• To close a note, click the Close box in the upper-left corner of the note window.
Technical Support
Micro Focus is dedicated to helping you achieve the highest possible performance from the
Micro Focus RM/COBOL family of products. The Micro Focus Customer Care team is
committed to providing you with prompt and professional service when you have problems or
questions about your Micro Focus products.
These technical support services are subject to Micro Focus’ prices, terms, and conditions in
place at the time the service is requested.
While it is not possible to maintain and support specific releases of all software indefinitely,
we offer priority support for the most current release of each product. For customers who
elect not to upgrade to the most current release of the products, support is provided on a
limited basis, as time and resources allow.
Support Guidelines
When you need assistance, you can expedite your call by having the following information
available for the technical support representative:
1. Company name and contact information.
2. Micro Focus RM/COBOL product serial number (found in the Electronic Software
Delivery email, on the media label, or in the product banner message).
3. Micro Focus RM/COBOL product version number.
4. Operating system and version number.
5. Hardware, related equipment, and terminal type.
6. Exact message appearing on screen.
7. Concise explanation of the problem and process involved when the problem occurred.
Test Cases
You may be asked for an example (test case) that demonstrates the problem. Please
remember the following guidelines when submitting a test case:
• The smaller the test case is, the faster we will be able to isolate the cause of the problem.
• Do not send full applications.
• Reduce the test case to the smallest possible combination of components required to
reproduce the problem.
• If you have very large data files, write a small program to read in your current data files
and to create new data files with as few records as necessary to reproduce the problem.
• Test the test case before sending it to us to ensure that you have included all the
necessary components to recompile and run the test case. You may need to include an
RM/COBOL configuration file.
When submitting your test case, please include the following items:
1. README text file that explains the problems. This file must include information
regarding the hardware, operating system, and versions of all relevant software (including
the operating system and all Micro Focus products). It must also include step-by-step
instructions to reproduce the behavior.
2. Program source files. We require source for any program that is called during the
course of the test case. Be sure to include any copy files necessary for recompilation.
3. Data files required by the programs. These files should be as small as possible to
reproduce the problem described in the test case.
This chapter lists the hardware and software required to install CodeWatch for Windows and
describes how to install the product.
Note For information on BIS-based debugging on an IIS web server, see the CodeWatch for
Xcentrisity Business Information Server User’s Guide Supplement (Version 12).
System Requirements
Your computer configuration is the assembled set of hardware and software that makes up
your system. Before you install CodeWatch, please make sure that your computer meets
these minimum requirements.
Required Hardware
To run CodeWatch, you must have hardware similar to what is needed to run RM/COBOL
version 12 for Microsoft 32-bit Windows. These system requirements include:
• An IBM PC or compatible machine, capable of running Microsoft Windows 2000,
Microsoft Windows XP, Microsoft Windows Server 2003, Microsoft Windows Vista, or
Microsoft Windows Server 2008, is required.
• A minimum of 512 megabytes of random access memory (RAM). Depending on your
configuration, CodeWatch may run with less memory, but this is not recommended.
• Ten megabytes of disk space for the CodeWatch program and supporting dynamic-link
libraries (DLLs), and for updating system libraries, as required.
• An 1024 x 768 x 256 color display adapter. (1280 x 1024 x 256 or better is
recommended, however.) Adapters that support more than 256 colors will eliminate
screen flashing as you move between programs. Although CodeWatch will run in 640 x
480 x 256, this is not recommended.
Note Most Micro Focus RM/COBOL products and licenses are distributed electronically. If
you elect to receive physical media, an optical drive capable of reading a CD-ROM (for the
product) and a 3.5” floppy drive (for the license certificate file) are required at installation
time.
Required Software
To run CodeWatch, you must have the following software installed on your computer:
• One of the following operating systems is required:
− Microsoft Windows XP
− Microsoft Windows Server 2003
− Microsoft Windows Vista
− Microsoft Windows Server 2008
− Microsoft Windows Server 2008 R2
− Microsoft Windows 7
− Microsoft Windows 8 and 8.1
− Microsoft Windows Server 2012
− Microsoft Windows Server 2012 R2
− Microsoft Windows 10
− Microsoft Windows Server 2016
• An RM/COBOL development system, version 12 for Microsoft 32-bit Windows or 64-bit
Windows.
− To run RM/COBOL programs with the 64-bit runtime system requires CodeWatch
version 12.13.
− To compile RM/COBOL programs with the 64-bit compiler requires CodeWatch
version 12.14.
System Installation
CodeWatch is generally installed when you install an RM/COBOL for Windows development
or runtime system. However, if you did not install CodeWatch when you initially installed
RM/COBOL, simply reinstall RM/COBOL and select only the CodeWatch component for
installation.
You may also automate the installation program for CodeWatch, which allows the installation
of CodeWatch to be incorporated with the installation of your application. For more
information, navigate to https://supportline.microfocus.com/productdoc.aspx, Micro Focus
Developer – COBOL and Software Developer Tools | RM/COBOL | 12 | Windows Installer
Guide and refer to the “RM/COBOL CodeWatch Integrated Development Environment”
section of the RM-Install Program User’s Reference documentation.
Installation Note After any installation of an RM/COBOL development system, the default
character set for new workspaces is OEM/DOS. If you wish to use the ANSI/Windows
character set as the default for new workspaces, the RMSETNCS utility, described in the
RM/COBOL User's Guide, should be run with the /cs_ansi command line option. Existing
workspaces are not affected by the default character set for new workspaces. For information
on changing the character set for a workspace, see the Select Character Set dialog box
(on page 95). For information on character sets in CodeWatch, see Character Sets (on
page 104).
For further details on character sets in RM/COBOL for Windows, including details on the
RMSETNCS utility, see “Character Set Considerations for Windows” in Chapter 3:
Installation and System Considerations for Windows of the RM/COBOL User's Guide.
This chapter provides a quick start tutorial of CodeWatch. The tutorial is followed by a more
in-depth, step-by-step walk through of a basic CodeWatch debugging session, including
sections and exercises on:
• Starting CodeWatch (see page 17)
• Configuring a workspace (see page 20)
• Viewing and editing program source (see page 24)
• Running the program (see page 25)
• Changing the workspace (see page 33)
• Saving the workspace (see page 33)
Note The information provided in this tutorial section is for traditional CodeWatch for
Windows source code debugging. For BIS-based debugging on an IIS web server, see
the CodeWatch for Xcentrisity Business Information Server User’s Guide Supplement
(Version 12).
2. In the Workspace wizard, press the New File button (depicted to the left). If you prefer,
you can dismiss the wizard by pressing the Cancel button or the Esc key, and then
choose New from the File menu or press Ctrl+N.
In either case, a blank page will appear in the CodeWatch main window.
3. From the File menu, choose Save. The Save As dialog box is displayed.
If you don’t see the “Projects” folder as depicted above, navigate to:
C:\Users\Public\Documents\Micro Focus\RM\CodeWatch\Projects
4. Create a folder named “Hello” by clicking the “New Folder ” icon on the icon bar.
Then double-click on the “Hello” Folder to open it, then type Hello.cbl in the File name
box. Or, choose the directory wherein you wish to work, and then type in Hello.cbl in
the File name box.
5. Make sure that the Add to Workspace check box and the COBOL Source File option
are selected.
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
PROCEDURE DIVISION.
MAIN.
DISPLAY "HELLO WORLD", LINE 5, ERASE.
Note The icon for Hello.cbl on the Files tab is red, which indicates that the file has not
been compiled. Different elements of the program are colored on your screen: COBOL
reserved words are black, literal strings are cyan, and user-defined words are blue. The
status bar indicates “This PC”, which is the machine being targeted for debugging; “32-
Bit”, which is the runtime system that will be used; and “IDLE”, the CodeWatch state.
For more information, see Contents of the Source Code/Edit Window (on page 98).
7. Compile the program by clicking in the Source Code/Edit window and choosing Compile
“Hello.cbl” from the Build menu. (If your focus is not in this edit window, choose the
Compile File menu command.)
8. If you have not saved the program, you will be prompted to save your changes. Press the
Y key or click Yes.
The file will be saved and compiled, and you will see the following in the CodeWatch
main window.
Note Clicking More Options opens the Program page of the Workspace Properties
dialog box. Refer to Program Tab (on page 81) for further information.
10. Click OK. CodeWatch will remember your choice. The CodeWatch main window will
appear as shown below.
11. To set a breakpoint, click anywhere in line 00005 and from the Run menu, choose
Breakpoint | Set or press F9.
A solid red circle will appear to the left of the line number to indicate that a breakpoint
has been set.
12. In the Data window, click the Breakpoints tab. This area indicates that execution will
stop at line 5 in program HELLO.
13. From the Run menu, choose Resume or press F5 to run the program. The highlight will
advance to the line containing the breakpoint and execution will stop.
14. To single-step the program, choose Step Statement or press F8 from the Run menu.
You should see HELLO WORLD in the RM/COBOL runtime window. (If this window
is not visible, press F12 to bring it to the front.)
15. Click anywhere in the CodeWatch main window and press F8 to step again, or press F5
to run the program to completion.
The RM/COBOL runtime window will close and CodeWatch will be “IDLE” again.
16. To exit CodeWatch, choose Exit from the File menu.
17. At the prompt to save your changes to Workspace1, click Yes and give the workspace a
name (for example, Hello).
The workspace will be saved as a workspace file, Hello.cwf, and may be quickly
reloaded later. See Starting CodeWatch Using a Saved Workspace (on page 17).
Starting CodeWatch
When you install CodeWatch, the installation process automatically creates a new Start Menu
item for CodeWatch in Windows. You have a number of choices for starting CodeWatch,
including the following:
• Starting CodeWatch from Windows (see the next topic)
• Starting CodeWatch using a saved workspace (see page 17)
• Starting CodeWatch from a Command Prompt (see page 18)
• Starting CodeWatch with a Runtime Command line (see page 19)
Using these methods, CodeWatch normally opens the Workspace wizard to help you establish
and configure a workspace for the session. For more information, see Configuring a
Workspace (on page 20).
this technique if you run other applications that also use the .cwf file type for document
files. Once started, CodeWatch will automatically repair the .cwf extension.
• To start CodeWatch with a previously saved CodeWatch workspace, using a command
line, enter:
rmcw filename.cwf
This command causes CodeWatch to open the specified workspace file. The .cwf
extension must be specified, because it uniquely identifies this command line format.
When you start CodeWatch using a saved workspace file, there are several considerations to
keep in mind:
• Workspace files are ASCII text files and can be carefully edited outside of CodeWatch.
For additional information, see External Editing Tab (on page 111).
• To avoid ambiguity, COBOL programs should not use the .cwf extension.
• If the filename contains a space, the entire filename must be enclosed in double quotes.
start rmcw
The Workspace wizard is displayed unless it has been disabled, as described in the
following item.
• To start CodeWatch without displaying the Workspace wizard, enter one of the
following:
start rmcw /n
start rmcw –n
Note To invoke the Workspace wizard at any time, from the File menu, choose New and then
Workspace. If a workspace is currently open, do one of the following to invoke the wizard:
• From the File menu, choose Workspace and then click New.
• From the File menu, choose Workspace and then click Properties.
CodeWatch also may be started with an RM/COBOL Runtime Command line, as described in
the following section.
Note In addition to being able to specify a RUNCOBOL command line, or the name of a
CodeWatch workspace file, you can also start CodeWatch from a DOS command line with
the name of a .CBL or .CPY file. CodeWatch will create a default workspace for the file, and
set the current working directory to the directory that contains the file.
This command creates a workspace using the RM/COBOL runtime options specified in
runcobol-command-line. Note that runcobol-command-line should not include the name of
the runtime itself, but may include any runcobol options. For example:
or the equivalent:
When you start CodeWatch with a Runtime Command line, there are several considerations to
keep in mind:
• CodeWatch accepts either the Windows or UNIX style, but the two styles cannot be
mixed in a single command. See Chapter 7: Running of the RM/COBOL User’s Guide
for a complete description of the Runtime Command line syntax.
• A dash (-) may be used instead of a slash (/) in the UNIX style, and the option letters are
not case-sensitive in either style.
• If a filename contains a space, the entire filename must be enclosed in double quotes.
• The /D (Debug) Runtime Command Option is always assumed to be present, even if not
specified. This allows rmcw to be used instead of runcobol in existing batch scripts.
The /D Option may be disabled by choosing Properties from the File menu and selecting
the No Debug option on the Program tab (see page 81) of the Workspace Properties
dialog box.
• As is true with the RM/COBOL runtime system, some options cannot be set from the
Windows command prompt when using CodeWatch. It may be necessary to define
RMPATH, RUNPATH, or other environment variables in the Workspace Properties
dialog box to completely replicate the execution environment. To open the Workspace
Properties dialog box, choose Workspace | Properties from the File menu. Programs
running under CodeWatch also inherit any previously set environment variables.
To navigate quickly through the other pages of the Workspace wizard, press Enter. The
options on all these pages of the Workspace wizard are described in more detail in
CodeWatch Workspace Wizard (on page 35).
Once you save a workspace, the next time the wizard opens you will see a list of recently used
configurations in the Recent Workspaces list. This allows you to select the Use a Saved
Workspace option and then choose a saved workspace (with preset options) from the list,
which can be used as a template, if desired, for a new workspace.
Tip To enter an RM/COBOL Runtime Command line quickly, click the Command button in
the Workspace wizard. In the Set/Edit Command Line dialog box, type the command line in
the edit box. Be sure to start with the name of the main program or program file. When you
click OK, the fields in the Workspace wizard will be filled in from the command line that you
entered. While the wizard is open, you can also press the Command button at any time to
view or directly change the command line.
See the next section and exercise for steps on how to configure a new workspace.
Configuring a Workspace
Once you have started CodeWatch, you will need to tell CodeWatch how to run your
program. At a minimum, CodeWatch needs to know the name of your main program or
program file and the directory where you wish to run the program. However, most
RM/COBOL applications consist of many separately compiled programs and have additional
requirements, which include:
• COBOL program files and libraries
• Configuration files
• Filename synonyms and other environment variables
• Runtime Command line options
• Source files
• Compilation options
• Directories to search for program files and source files
CodeWatch combines all of this information, and more, into a workspace. For convenience, a
workspace can be saved to a file for later retrieval.
There are several ways to create a new workspace:
• Start CodeWatch using any of the methods discussed in Starting CodeWatch (on page 17)
without any RM/COBOL Runtime Command line options specified.
• Start CodeWatch with a runcobol command line. See Starting CodeWatch with a
Runtime Command Line (on page 19).
• If CodeWatch is already running, from the File menu, choose Workspace | New.
The Workspace wizard opens and then leads you through the process of creating the
workspace. The name of the program or program file you wish to run is all that is required
(although the working directory may also need to be specified).
Note You can bypass the Workspace wizard by clicking on the Command button in the
wizard and entering a command line. To start CodeWatch without starting the wizard, specify
/n on the command line. For more details, see Starting CodeWatch from a Command Prompt
(on page 18).
C:\Users\Public\Documents\Micro Focus\RM\CodeWatch\Projects
Run Path Directories to place into the RUNPATH environment variable. These
directories are searched in the specified order to locate RM/COBOL
programs (.cob) and application data files.
Program Contents of the PATH environment variable. These are searched in
the specified order to locate applications (.exe, .com, and .bat) and
application extensions (.dll).
Environment Additional options to place into the Windows environment, such as
filename aliases (synonyms). This feature is provided for backward
compatibility. Micro Focus recommends that aliases be placed in the
Windows registry file using the RM/COBOL configuration utility
(rmconfig.exe). For more information, refer to the “Windows
Registry” and “Setting Synonym Properties” topics in Chapter 3:
Installation and System Considerations for Windows of the
RM/COBOL User’s Guide.
Source List of directories to be searched for source files. This list is used if a
source file cannot be located using the information embedded in the
program file or library file. These directories are also placed in the
RMPATH environment variable when compiling files and are used
by the compiler to locate source and copy files.
Tips
• Remember that you can press Command at any time from within the Workspace
wizard and manually enter options using the Runtime Command line syntax. You
can also view the command line that will be used to run the program by clicking this
button.
• Once the wizard is closed, you can change runtime options at any time. From the
File menu, choose Workspace | Properties to open the Workspace Properties dialog
box (see page 80).
8. For this example, do not change any settings on the Set Environment page. Simply click
Finish or press Enter.
Configuration of a workspace is now complete. The Workspace window, displayed on
the left side of the frame of the CodeWatch main window, shows the contents of your
CodeWatch workspace.
The only item in the Main Program folder is the name of the main sample program,
<verify>. The angle brackets indicate that possible ambiguities related to the program
name have not been resolved; that is, verify may refer either to a standalone program
named VERIFY.COB or to a program named verify in a COBOL library that has not yet
been configured. CodeWatch cannot resolve these ambiguities until execution begins, as
you may not yet have completed configuring the workspace.
Note At the bottom of the Workspace window, the Programs and Files tabs allow you
to choose between two views of the workspace. The Programs tab lists the programs in
the workspace. The Files tab lists all of the files in the workspace. Currently, there are
no files in the Files tab because the program file that contains program verify is not
discovered until the workspace is run for the first time. For a more complete description
of the CodeWatch windows and user interface, see Chapter 3: CodeWatch Interface (on
page 35).
• There are program name ambiguities that have not yet been resolved. In this case, the
name is shown in angle brackets.
WARNING CodeWatch will load the first occurrence of a given filename that is found when
following this search sequence. It is possible that an incorrect file will be displayed if another
file of the same name is found first.
Counterclockwise from the upper left, the following windows are displayed:
• Continuing from Exercise 4 (on page 26), click Animate from the Run menu to toggle
animation on or click the Animate toolbar button.
Note To indicate that this option is selected, a check mark appears next to the menu
command.
If the program halts for any of the above reasons except for the last, you can resume
program execution with the Resume command from the Run menu or any of the other
commands on the Run menu. Alternatively, you can choose Stop from the Run menu to
terminate the program.
Setting Breakpoints
A breakpoint causes program execution to pause, which gives you the opportunity to look
around at the program, examine variables, or set additional breakpoints.
Breakpoints are part of the workspace and are, therefore, saved and loaded with the
workspace. Any breakpoints that are set when you save a workspace will be set the next time
you open the workspace.
Breakpoints are set by program name, line number, and statement number. If you have two
programs in your workspace with identical names, and both programs contain the line number
on which the breakpoint was set, execution will stop at both lines.
If a line contains a breakpoint, the Source Code Editor displays a red circle in front of the line
number. The breakpoint is also reported in the Breakpoints tab (see page 52) of the Data
window. If the breakpoint is enabled, the red circle is solid; if the breakpoint is disabled, the
red circle is hollow.
Note In addition to pressing F9, you can set breakpoints by using any of the following
methods:
• Click on the line in the Source Code/Edit window (see page 97) and choose Breakpoint |
Set from the Run menu, or click the Toggle Breakpoint toolbar button.
• Right-click anywhere in the line in the Source Code/Edit window and choose Set
Breakpoint from the pop-up menu. Note that you can also remove breakpoints, or
temporarily disable and later enable breakpoints by using this menu.
• Press Ctrl+B or click the Edit Breakpoints toolbar button to display the Breakpoints &
Watchpoints dialog box and interactively set, remove, or modify breakpoints using the
Code Breakpoints tab (see page 88).
• Display the Breakpoints tab (see page 52) in the Data window by choosing Breakpoints
Tab from the View menu or pressing Alt+1 to display this tab in the window, if not
visible. Then, press Ins to insert a new breakpoint, Del to delete a breakpoint, click the
icon (solid red circle) to enable or disable a breakpoint, or press F2 to examine or change
a breakpoint’s properties in the Code Breakpoints page of the Breakpoints & Watchpoints
dialog box.
• Alternatively, you can cause a break at any time by choosing Break from the Run menu,
pressing F5, or by clicking the Run toolbar button again while the program is running.
Setting Watchpoints
A watchpoint allows you to examine or modify the contents of your COBOL data items.
Watchpoints are displayed in the Watchpoints tab (see page 53) in the Data window and are
updated whenever a program break occurs. You can also request that a program break occur
when there is a change in the value of the data item being watched.
Watchpoints are part of the workspace and are, therefore, saved and loaded with the
workspace. Any watchpoints that are set when you save a workspace will be set the next time
you open the workspace.
The program NUCTEST has now been added to the Called Programs folder in the
Workspace window, and the program file NUCTEST.COB has been added to the list of
program files in the Workspace window.
Note In addition to the method described in the preceding exercise, you can set watchpoints
by using any of the following methods:
• Highlight and then right-click a data item name in any Source Code/Edit window and
choose Watch Data Item or press Alt+F9 from the pop-up context menu.
• Double-click a data item name in any Source Code/Edit window to display the
Inspect/Modify dialog box. After examining and possibly modifying the value, you can
click the Watch button in that dialog box to set a watchpoint (see the following section).
• Press Ctrl+W or click the Edit Watchpoints toolbar button to display the Breakpoints &
Watchpoints dialog box and interactively add, remove, modify, or enable or disable a
program break when the value of the watchpoint changes using the Data Watchpoints
page (see page 89).
• Display the Watchpoints tab (see page 53) in the Data window by choosing Watchpoints
Tab from the View menu or pressing Alt+2 to display this tab in the window, if not
visible. Then, press Ins to insert a new watchpoint, Del to delete a watchpoint, click the
icon (solid red circle) to enable or disable a watchpoint, or press F2 to change a
watchpoint’s properties in the Data Watchpoints page of the Breakpoints & Watchpoints
dialog box.
2. In the Type list box (this is an optional field), select or enter a data type. For a
description of allowed data types, see “Data Types” under the “General Debug Concepts”
section in Chapter 9: Debugging of the RM/COBOL User’s Guide.
3. Click Show or press Enter.
The current value of the identifier is then displayed in the Show text box using either the
selected type or the actual type of the identifier. If the identifier cannot be displayed, an
error message is displayed in red. Note that the program must be running and the
identifier must be “in scope” before a value can be displayed. See the description of the
Show option in the Inspect/Modify dialog box (on page 66).
Note Closing either the Workspace window or the CodeWatch main window will also stop
the program.
The workspace is saved in a file with an extension of .cwf (CodeWatch Workspace File).
This file is an ASCII text file that can be examined and modified with any text editor. If you
have a COBOL application with a large number of libraries, it may, in some cases, be easier
to create a workspace, close CodeWatch, and then add the libraries to the workspace file using
a text editor. This practice, however, is not recommended.
Note When you close CodeWatch or the Workspace window, you will be prompted to save
the workspace if any changes have been made.
This chapter provides detailed descriptions of the Workspace wizard, and the various
windows, dialog boxes, menus, and toolbars found in CodeWatch.
Note The information provided in this user’s guide is for traditional CodeWatch for
Windows source code debugging. For BIS-based debugging on an IIS web server, see
the CodeWatch for Xcentrisity Business Information Server User’s Guide Supplement
(Version 12).
you to save the workspace if the workspace has not previously been saved, or has been
changed since the last save. You may also save and close the workspace by choosing the
Workspace | Save command from the File menu. To save and rename the workspace, choose
Workspace | Save As from the File menu.
The Workspace wizard consists of four pages: Introduction (New), Set Program to Run, Set
Additional Options, and Set Environment. Several buttons appear along the bottom of the
Workspace wizard no matter which page is selected and displayed. They perform the same
function or action on all the pages of the wizard and are described below.
Workspace Wizard
Command Open the Select/Edit Command Line dialog box where you can view
or edit the RM/COBOL Runtime Command line options. This option
is for advanced users.
Cancel the Workspace wizard and create a new source file. A
workspace can automatically be created when the file is saved.
Cancel the Workspace wizard and display an Open a COBOL File or
a Workspace dialog box where you can open an existing workspace
file or any text file into the Source Code/Edit window. Select the
Add to Workspace check box to create a workspace automatically for
one of the following files:
• COBOL Source File
• COBOL Copy File
• COBOL Program File
• COBOL Program Library File
You can then use either the Open or Insert Items command from the
File menu to add more files to the workspace. In all the cases above,
the working directory is set to the directory containing the file.
To configure the workspace (see page 80), choose Workspace |
Properties from the File menu. See also Configuring a Workspace
(on page 20).
Back Display the previous page of the wizard. (Note that this button is
grayed out on the first page of the wizard.)
Next Display the next page of the wizard. (Note that this button does not
appear on the last page of the wizard.)
Finish Create the workspace using the settings from this and the preceding
pages. (Note that this button appears only on the last page of the
wizard.)
Cancel Cancel the wizard.
Help Display help for this page of the wizard.
Create New Create a new workspace without initializing any of the options on the
Workspace subsequent pages of the Workspace wizard.
In the Application Type list box, select the type of application you
will be debugging.
Note If you select the Xcentrisity BIS/IIS Web option, see the
CodeWatch for Xcentrisity Business Information Server User’s Guide
Supplement (Version 12) for more information.
Open a Saved Choose a saved workspace from the list of your most recently used
Workspace workspaces. The settings of the saved workspace will be used to
create the new workspace.
Note This option simply reads the preset options from the previous
workspace. It does not open the workspace.
In the Recent Workspaces list box, select a workspace file (.cwf)
from the list of recently used workspaces on the selected computer.
• Use the Browse button to open the Select a Workspace File dialog
box and search for saved workspaces that are not in the recently
used list.
Show this Wizard at Determine whether the Workspace wizard is displayed when
Startup CodeWatch is started. This option is selected by default.
For a description of the buttons that appear along the bottom of this page, see the CodeWatch
Workspace wizard (on page 35).
Program to Run Type or select the name of the COBOL program that CodeWatch is
to run. This can be one of the following:
• The filename of a COBOL program file (for example,
VERIFY.COB).
• The name of a COBOL program to be found in a COBOL library
file (for example, VERIFY).
CodeWatch uses the RM/COBOL runtime to locate programs (see
the “Subprogram Loading” topic in Chapter 8: RM/COBOL Features
of the RM/COBOL User’s Guide, for a complete description of the
methods). For example, if VERIFY is specified as the program to
run, and VERIFY is not found in any configured library, then the
RM/COBOL runtime system will optionally search for a synonym for
VERIFY in the environment, and will then search for a file named
VERIFY.COB that contains exactly one separately compiled COBOL
program in the current directory, the PATH, and the RUNPATH.
CodeWatch does not attempt to resolve an ambiguous main program
name until execution begins.
This box may be left blank. If a main program is not specified, you
will be asked for the program name when you run the workspace.
Click the Browse button to open the Select a Program File dialog box
where you can search for and select a COBOL program file (.cob).
64-Bit When checked, the 64-bit runtime system will be used. The checkbox
is disabled and unchecked if only a 32-bit runtime system is installed,
and is checked and disabled if only a 64-bit runtime system is
installed.
Working Directory Select the current directory that is used when the COBOL program
begins execution. Click the down arrow in the list box to choose
from a list of recently used working directories.
Click the Browse button to open a Select a Directory dialog box
where you can search for and select a working directory.
Workspace This read-only field is the root location of the workspace. For new
workspaces, this is initially the same location as the Working
Directory, but is set to the directory that contains the workspace file
when the workspace is loaded or saved.
Whenever possible, the files in the workspace are processed using
this directory as a base directory. By saving the workspace into a
directory that contains all of your source files, COPY files, and object
files, those filenames can be stored as relative pathnames. This
makes workspace files portable between machines, and makes it
possible to check workspace .cwf files into version control systems.
Instrumentation When selected, enable instrumentation. This option is equivalent to
the /I Runtime Command Option.
Character Set Show the character set for this workspace. The character set is used
in the editor, during compilation, and during execution. Two
character sets are allowed:
• OEM/DOS
• ANSI/Windows
For a new workspace, the character set defaults to OEM/DOS after an
installation of RM/COBOL. The RMSETNCS utility may be used to
change the default character set for new workspaces to
ANSI/Windows.
After a workspace is created, the character set for that workspace
remains the same unless explicitly changed by the user. The default
character set for new workspaces can be overridden by specifying
one of the /cs_ansi or /cs_oem command line options when starting
CodeWatch. For more information, see System Installation (on
page 8).
To change the character set, click the Change button (this option is
described below).
Note For a detailed explanation of character sets within CodeWatch,
see Character Sets (on page 104). For further information about
character sets and the RMSETNCS utility in RM/COBOL, see
"Character Set Considerations for Windows" in Chapter 3:
Installation and System Considerations for Windows of the
RM/COBOL User's Guide.
Change Open the Select Character Set dialog box (see page 95) to change the
character set assumed for the workspace. The dialog box also allows
configuring the euro symbol for use in the CodeWatch editor.
Switches Set or clear the current set of runtime switches. The eight switches
are numbered consecutively from left to right. These options are
equivalent to the /S Runtime Command Option.
For a description of the buttons that appear along the bottom of this page, see the CodeWatch
Workspace wizard (on page 35).
Arguments to Main Enter arguments to be passed to the main program. This option has the
Program following format:
[delimiter]string[delimiter]
The delimiter character may be either a single or double quote, must not
appear within string, and is required only if string contains spaces or
tabs. If you enter a string that contains spaces, but do not use a delimiter,
CodeWatch will provide a delimiter or display an error if no delimiter
can be chosen. This option is equivalent to the /A Runtime Command
Option.
Overriding Select or enter the name of the primary runtime configuration file. This
Configuration File file completely overrides the default runtime configuration. This option
is equivalent to the /C Runtime Command Option. If a relative path is
specified, the path is interpreted as relative to the directory specified in
the Working Directory option on the Set Program to Run page (see page
38) of the wizard.
Click the Browse button to open the Select a Configuration File dialog
box where you can search for and select a configuration
file (.cfg).
Supplemental Select or enter the name of the supplemental runtime configuration file.
Configuration File The contents of this file supplement the default runtime configuration
without replacing it. If an overriding configuration is specified, the
contents of this file supplement that configuration. If no other
configuration is specified, this file provides the complete configuration.
This option is equivalent to the /X Runtime Command Option. If a
relative path is specified, the path is interpreted as relative to the
directory specified in the Working Directory option on the Set Program
to Run page (see page 38) of the wizard.
Click the Browse button to open the Select a Configuration File dialog
box where you can search for and select a configuration
file (.cfg).
ACCEPT Buffer Enter the maximum buffer size to be used by ACCEPT and DISPLAY
Size statements. The maximum size is 65280 characters, and the default size
is 264 characters. This option is equivalent to the /B Runtime Command
Option.
Memory for Sort Enter the amount of memory (in bytes) to be used for a sort operation.
The default is 256000 bytes. Specify a larger value to improve the
efficiency of sort operations. Decrease this value to allocate more
memory for other data or called subprograms. If neither SORT nor
MERGE operations will be used in this run unit, specifying 0 will free all
reserved memory for other uses. This option is equivalent to the /T
Runtime Command Option.
Level 2 ANSI When selected, indicate that Level 2 ANSI semantics are to be used for
Semantics for Format 1 ACCEPT and DISPLAY operations. The default is to use
Format 1 ACC/DIS Level 1 ANSI semantics for these operations. This option is equivalent
to the /M Runtime Command Option.
Suppress Startup When selected, suppress the banner message and the STOP RUN
and STOP RUN message. This option is equivalent to the /K Runtime Command Option.
Messages
For a description of the buttons that appear along the bottom of this page, see the CodeWatch
Workspace wizard (on page 35).
The following buttons appear on each of the tabs of the Set Environment page and perform
the same function on each tab.
For a description of the buttons that appear along the bottom of this page, see the CodeWatch
Workspace wizard (on page 35).
The following briefly describes the elements of the window frame area of the CodeWatch
main window.
Area Description
Title Bar Displays the text, “CodeWatch for Windows”, followed by the name
of the current workspace and the file being displayed. You can move
the CodeWatch main window by clicking the title bar and dragging
with the mouse.
Menu Bar Use drop-down menus on the menu bar to display CodeWatch
commands and subcommands. The menus available depend on
whether or not a program file has been opened. For more
information, see Menus and Toolbars (on page 68).
Area Description
Toolbar Click buttons on the toolbar to choose menu commands quickly. The
toolbar buttons available depend on several factors, including
whether or not a program file has been opened and whether the
program is running. For more details, see Menus and Toolbars (on
page 68).
Note that an option on the View menu allows you to show or hide
toolbars. You can move a toolbar at a different position in the
CodeWatch main window by dragging the toolbar’s gripper bar (the
two etched lines at the left end of the toolbar) with the mouse. You
can detach a toolbar from the main window and float it anywhere on
the screen by holding down the Ctrl key while dragging the toolbar.
Status Bar Displays current information about the targeted PC, the selected 32-
bit or 64-bit runtime system, the execution state, the date, the time,
and the keyboard state. The execution state field indicates the state
of the program you are debugging and may display one of the
following messages:
• NO PROGRAM. No program has been configured into the
workspace.
• IDLE. The program is not currently running.
• LOADING. The program is loading.
• READY. The program has been loaded, is ready to run, and is
awaiting a Debug Command.
The CodeWatch main window may contain zero or more Workspace windows. These
windows are used to perform most of the actual work in CodeWatch. Table 1 describes the
characteristics of the three types of Workspace windows.
Dockable Windows Dockable windows have a small title bar, and are initially attached to
the frame of the CodeWatch main window or to each other. Dockable
windows can be:
• Docked to the inside of the frame of the main window.
• Floated outside of the frame of the main window anywhere on the
screen.
• Converted to or from a document window. To convert a docked
window into a document window or back again, choose Docked
from the Window menu.
• To undock a docked window, choose Floating from the Window
menu. You can then move the window around by dragging its
title bar. To prevent the window from docking as you move it
over the window frame, hold down the Ctrl key.
• Right-clicking within the dockable window provides access to a
menu that allows you to toggle between Docked and Floating. In
addition, right-clicking the title bar of a dockable window
displays a menu with additional options that allow you to
precisely control how and where the window docks.
Document Windows Document windows have a large title bar and usually occupy a large
part of the CodeWatch main window. A document window cannot be
moved outside the boundaries of the frame of the main window but can
be positioned anywhere within the frame of the main window not
occupied by a dockable window.
When a document window is maximized to occupy the entire document
area, the title bar is hidden.
The tab at the bottom of a document window allows a window to be
quickly chosen. A traditional MDI window style can be selected by
changing the Window Style on the EditView
PreferencesMiscellaneous tab.
For more information, see Document Windows (on page 59).
Floating Windows Floating windows are similar in appearance to dockable windows, but
cannot be docked and always float free of the frame of the CodeWatch
main window. Floating windows are used by the Find command on the
Edit menu and the Data Item command on the View menu.
For more information, see Floating Windows (on page 62).
The following sections describe the content of the CodeWatch main window.
Dockable Windows
Three of the windows used in CodeWatch are dockable. These include the following:
As discussed in Table 1 on page 46, CodeWatch allows you to convert any dockable window
into a document window. To do so, click in the window you wish to convert, and uncheck
Docked on the Window menu. This option is also available on the pop-up context menu that
appears if you right-click in the window or on the title bar of any of the dockable windows.
Workspace Window
The Workspace window is initially docked to the left side of the frame of the CodeWatch
main window, and allows you to examine and manipulate the contents of the workspace. The
Workspace window is always visible when a workspace is active. By clicking on the
Workspace window’s title bar, you can reposition it anywhere within the CodeWatch main
window. You can close the Workspace window at any time by clicking the Close button
at the end of the window’s title bar.
The Workspace window includes two tabs:
• Programs tab (see page 48)
• Files tab (see page 49)
To see the workspace organized by programs, click the Programs tab. To see the workspace
organized by files, click the Files tab. If an item is preceded by a [+] symbol, the item is
expandable. Click [+] in front of an item to display the contents of that item. If an item is
preceded by a [-] symbol, click [-] to minimize the size of the list.
The following icons are used in the Workspace window:
Workspace Window
Closing the Workspace window also closes the workspace. CodeWatch will prompt you to
save the workspace if the workspace has not been saved, or if changes have been made since
the last save. You can then save or discard the changes before closing the workspace, or
cancel the operation.
Programs Tab
The Programs tab in the Workspace Window, illustrated to
the right, contains the names of all of the programs in the
workspace, organized into three sections:
• Main Program. Contains the name of the main
RM/COBOL program. If the name has not been
resolved, the name is enclosed in <angle brackets> to
indicate that it is a placeholder. As depicted here, the
icon is red if the file has been edited.
• Called Programs. When debugging, contains a list of
programs that have been called during the current run.
The currently active program is always at the top of the
list.
• Other Programs. Contains a list of the programs that
have not yet been called in the current run.
Files Tab
The Files tab in the Workspace Window, illustrated to the
right, contains the names of all of the files in the workspace,
organized into four sections:
• Source Files. Contains the list of source files in the
workspace. Source files that are inserted into this list as
a result of a reference from a program are displayed
using a green icon. Source files that are inserted
manually using the Open or Insert Items commands
from the File menu appear gray.
• Copy Files. Lists all copy files in the workspace.
Copy files that are inserted into this list as a result of a
reference from a program are displayed using a green
icon. Copy files that are inserted manually using the
Open or Insert Items commands from the File menu
appear gray.
• Program Files. Contains the RM/COBOL program
files, by name, that are run.
• Library Files. Contains the RM/COBOL library files
that were specified using the /L Runtime Command
Option or that were added to the workspace library list.
selected tab. The following table displays the possible context-menu commands and their
purpose. See also Menus and Toolbars (on page 68).
Insert Source File Ins Displays the Open File dialog box and allows you
Insert Copy File to choose one or more files to be added to the
Insert Program File workspace.
Insert Library File The type of item added by this menu command is
determined by the currently highlighted item in
the Workspace window. For example, to insert a
source file, right-click on an existing source file
or the Source File folder in the Files tab.
You can insert any number of files in one
operation by holding down the Shift key when
selecting files in the Open File dialog box. All
files must be the same type.
Note that the menu command displayed will
reflect the action that will be performed.
Remove “filename” Del Removes the specified item from the workspace.
The type of item that is removed is determined by
the selection. For example:
Data Window
The Data window, illustrated below, displays information about the program that you are
debugging. This window contains a set of five tabs:
• Breakpoints tab (see page 52)
• Watchpoints tab (see page 53)
• Data Files tab (see page 54)
• Call Stack tab (see page 55)
• Build Results tab (see page 56)
To select a tab in the Data window, click it. Alternatively, from the View menu, select the
command or press the shortcut key that corresponds to the tab you want to display.
The Data window is opened automatically whenever you click the Start command from the
Run menu or click the Run toolbar button. You can close the Data window at any time by
clicking the Close button at the end of the window’s title bar.
To reopen the Data window, choose either Breakpoints Tab, Watchpoints Tab, Data Files
Tab, Call Stack Tab, or Build Results Tab from the View menu or press the corresponding
shortcut key.
Breakpoints Tab
To access the Breakpoints tab, illustrated below, do one of the following:
• Click the Breakpoints tab in the Data window.
• Choose Breakpoints Tab from the View menu.
• Press Alt+1.
Breakpoints Tab
Program The name of the program containing the breakpoint. The Debugger
does not differentiate between separately compiled programs and
contained (that is, nested) programs that have the same name.
Execution will stop when any instance of the named program is
entered and the specified line is encountered. The program name is
preceded by a red circle if the breakpoint is enabled, or by a hollow
circle if the breakpoint is temporarily disabled.
Line The number of the target line.
Stmt The statement number specified within the line. Leave this blank to
indicate that the break will occur when the first (or only) statement on
the line is executed. Or, specify an offset: +1 indicates the second
statement on the line, and +2 indicates the third.
Pass The number of times a breakpoint should be skipped before being
triggered. The default is to trigger the breakpoint on each pass. For
example, a value of 5 indicates that the breakpoint will be skipped
four times and then triggered. Once a breakpoint is triggered, it will
be triggered on each subsequent pass unless the pass count is set
again.
conditions attached to the breakpoint are satisfied. When disabled, the breakpoint has no
effect on the program.
• Add a new breakpoint by pressing the Ins key.
• Remove a breakpoint by pressing the Del key.
• Edit a breakpoint by pressing the F2 key.
• Display a pop-up context menu by right-clicking with the mouse (alternatively, press
Shift+F10). This pop-up menu allows you to change the properties of the Breakpoints
tab using the Code Breakpoints tab of the Breakpoints & Watchpoints dialog box (see
page 87), as well as perform the other operations listed above.
You can also set, clear, enable, or disable a breakpoint in the Source Code/Edit window (see
page 97) by one of the following methods:
• Double-click on the line number to set or clear a breakpoint.
• Right-click on a line to set, clear, enable, or disable a breakpoint by using the options on
the pop-up context menu.
Watchpoints Tab
To access the Watchpoints tab, illustrated below, do one of the following:
• Click the Watchpoints tab in the Data window.
• Choose Watchpoints Tab from the View menu.
• Press Alt+2.
Watchpoints Tab
Name The name of the data item being watched. The name is preceded by a
red circle to halt the program whenever the content of the data item
changes. A hollow circle indicates that the watchpoint will not halt
the program.
Loc The location of the data item within the program.
Type The type of the data item. This field determines how the value is
displayed. It defaults to the actual type of the data item, but may be
overridden using the Inspect/Modify dialog box (see page 66). For
example, INX-RECORD above was changed to display in HEX.
Value The value of the data item.
You can also add a watchpoint in the Source Code/Edit window (see page 97) by using one of
the following methods:
• Select the name of a data item with the mouse, double-click to inspect the data item, and
then click the Watch button in the Inspect/Modify dialog box (see page 66). (Note that
you can also modify the data item by adding qualification or subscripting in this way.
See the RM/COBOL User’s Guide for more information.)
• Select the name of a data item with the mouse, then right-click and choose Watch Data
Item from the pop-up context menu.
Program The name of the program. The currently active program is always
indicated by the blue arrow and is displayed at the top of the list. The
next line is the caller of the currently active program, and the next
line is its caller.
Note that you can return to the current program’s caller by choosing
Step Program from the Run menu (see page 77).
Line The number of the line currently executing in each program.
Pathname The filename of the COBOL program file or library that contains
each program.
You can perform the following operations in the Call Stack tab:
• Open a Source Code/Edit window (see page 97) and move to the indicated line by
pressing Enter or F2.
• Display a pop-up context menu by right-clicking with the mouse, or by pressing
Shift+F10. This pop-up menu allows you to change the properties of the Call Stack tab.
Note You can see a list of all programs that have been executed in this session by examining
the Programs tab (see page 48) in the Workspace window.
Name The name of the file. A red exclamation mark is displayed if the file
compiled with errors (indicating recompilation is required), and the
entire row is displayed in red if there were any errors or warnings.
Error The number of errors detected during the compilation.
Warn The number of warnings detected during the compilation.
Pathname The full pathname of the file.
You can perform the following operations in the Build Results tab:
• Open a Source Code/Edit window (see page 97) and move to the indicated line by
pressing Enter or F2.
• Display a pop-up context menu by right-clicking with the mouse, or by pressing
Shift+F10. This pop-up menu allows you to change the properties of the Build
Results tab.
New Ins Displays either the Code Breakpoints tab or the Data
Watchpoints tab of the Breakpoints & Watchpoints
dialog box (see page 87) and allows you to manually
define an item. This option is not enabled in the Data
Files, Call Stack, or Build Results tabs.
Delete Del Deletes the specified breakpoint or watchpoint. This
option is not enabled in the Data Files, Call Stack, or
Build Results tabs.
Properties Alt+Enter Displays the properties for the selected item and
allows you to edit the properties in either the Code
Breakpoints tab or the Data Watchpoints tab of the
Breakpoints & Watchpoints dialog box (see page 87).
This option is not enabled in the Data Files, Call
Stack, or Build Results tabs.
Edit Source F2 For breakpoints, the call stack, or build results, edits
the source file referenced by the selected item and
moves the cursor to the referenced line. This option
is not enabled in the Watchpoints or Data Files tabs.
Enabled Spacebar For breakpoints and watchpoints, enables or disables
the selected item. This option is not enabled in the
Data Files, Call Stack, or Build Results tabs.
Clear All For breakpoints and watchpoints, removes the
selected item. This option is not enabled in the Data
Files, Call Stack, or Build Results tabs.
Disable All Disables all breakpoints or watchpoints. This option
is not enabled in the Data Files, Call Stack, or Build
Results tabs.
Enable All Enables all breakpoints or watchpoints. This option
is not enabled in the Data Files, Call Stack, or Build
Results tabs.
Docked Checked (), if the Data window is docked to the
frame of the CodeWatch main window. Deselecting
this menu item converts the window from a dockable
window into a document window. Checking this
item docks the window to the frame of the main
window.
Floating Checked (), if the Data window is floating free of
the frame of the CodeWatch main window.
Deselecting this menu item docks the window;
checking this window causes the Data window to
float free in the frame in the main window.
Log Window
The Log window, illustrated below, is opened automatically whenever you click the Start
command from the Run menu or click the Run toolbar button. You can also access the Log
window by choosing Log Window from the View menu or pressing Alt+6.
You can close the Log window at any time by clicking the Close button at the end of the
window’s title bar. To reopen the Log window, choose Log Window from the View menu or
press Alt+6. The Log window is also opened automatically whenever you click the Start
command from the Run menu.
Command Action
Command Action
Floating Checked (), if the Log window is floating free of the frame in the
CodeWatch main window. Deselecting this menu item docks the
window; checking this window causes it to float free of the frame in
the main window.
Document Windows
The area within the frame of the CodeWatch main window that is not occupied by the
dockable windows (see page 46) is reserved for “document” windows. Document windows
have a large title bar, are listed in the Window menu, and always float only in the document
area of the main window. (If the document window’s title bar is not visible, click the
Restore button.) Unlike dockable windows, you can have any number of document windows
that are displaying different objects. You can even display the same object in two different
document windows. The Source Code/Edit window (see page 97) is an example of a
document window.
Note CodeWatch allows you to convert any dockable window into a document window. To
do so, click in the window you wish to convert, and uncheck Docked on the Window menu.
This option is also available on the pop-up context menu that appears if you right-click in the
window or on the title bar of the dockable window.
• Using the Document menu that appears when you click the document icon in the upper-
left corner of the title bar. If the document window’s title bar is not visible, restore the
document by clicking the Restore button.
• By clicking the Minimize, Maximize, or Close buttons on the upper-right corner of the
title bar.
Note If the document window is maximized, the Document menu icon is moved to the left
side of the menu bar and the buttons are moved to the right side of the menu bar.
Document Menu
The Document menu contains the following commands. The corresponding shortcut key and
button, if applicable, are also shown.
Document Menu
Document Menu
When CodeWatch is closed, it remembers the state of the last document window (maximized
or normal), and that setting is used the next time CodeWatch is started.
In either case, the document window is immediately transected by a horizontal and a vertical
divider (called a split bar), and the intersection of the dividers may be moved with the mouse
or the arrow keys on the keyboard. Press the Enter key or release the mouse button when you
are finished positioning the split bar.
When you split document windows, there are several considerations to keep in mind:
• To divide the window into two panes instead of four, drag the unwanted split bar to
the edge of the window.
• The panes may be positioned independently, but only the pane containing the cursor
is active.
• To move the cursor into the next pane, choose Pane | Next from the Window menu or
press F6. To move the cursor into the previous pane, choose Pane | Previous from the
Window menu or press Shift+F6.
Note Neither of the Pane commands will activate a different document window. To
activate a different document, press Ctrl+F6 or Ctrl+Shift+F6.
• To adjust the split bar, choose Split from the Window menu. To move the divider with
the mouse, simply click and drag the split bar to the new position.
• To close a pane, drag the split bar to the edge of the window with the keyboard or the
mouse, or double-click the divider with the mouse.
These functions close only the currently active document window and close the document if
there is only one open document window. If you used the New Window command from the
Window menu to create additional windows on the document, the document is not closed
until all windows are closed.
Floating Windows
Floating windows “float” over the CodeWatch main window and may be revealed or hidden
at any time. Three of the dialog boxes used in CodeWatch are floating type windows:
• Find dialog box (see the following topic)
• Replace dialog box (see page 65)
• Inspect/Modify dialog box (see page 66)
Find what For the current file, type the information you want to search for (this
is referred to as the search criteria). Or, click a previous search entry
from the list.
Match whole word Match the search string only if the found occurrence is delimited by:
only
• spaces, tabs, or the beginning and/or end of the line, or
• any of the following characters:
\ " ' ` ~ - = ! @ # $ % ^ & * _
( ) + [ ] { } | ; : . , < > / ?
For example, searching for “25” when this option is not checked will
match “1255” and “A25”. Checking this option ensures that only
“25” is matched.
Match case When selected, find only the text that exactly matches the search text
criteria. When not selected, uppercase and lowercase letters are
considered to be identical. Therefore, searching for ABC will match
“abc” and “AbC” in addition to “ABC”.
Regular expression When selected, specify that the search text is a UNIX-style regular
expression. This provides the ability to perform powerful search
operations. For more information, see Regular Expressions (on
page 64).
Direction Control the direction of the search: select Down to search forward in
the file toward the end, or select Up to search backward in the file
toward the beginning.
Find Next In the current file, find the next occurrence of the text string entered
or selected in the Find what list box in the specified direction. If
found, the text is highlighted.
Pressing F3, choosing Find Next from the Edit menu, or clicking the
Find Next toolbar button performs this same operation using the
current settings in the Find dialog box, even if the Find dialog box is
not open (or visible).
Find the previous occurrence of the text in the current file. If found,
the text is highlighted. Note that pressing Shift+F3, choosing Find
Previous from the Edit menu, or clicking the Find Previous toolbar
button performs this operation using the current settings in the Find
dialog box, even if the window is not visible.
Mark All Mark all the found occurrences.
Cancel Close the Find dialog box without matching and cancel all entries
made in the dialog box.
Regular Expressions
CodeWatch allows you to search for text patterns, called regular expressions, rather than fixed
strings. You indicate that the search string is a regular expression by checking the Regular
expression check box in either the Find dialog box (see page 63) or the Replace dialog box
(see page 65).
Regular expressions are made by combining normal characters with a number of special
characters. For example:
^b
/*88b
/b
/*[FfG-I]
where b/ is a space that matches “88,” followed by one or more spaces, followed by any of the
letters in the string “FfGHI”. The 88 must be the first non-blank characters on the line.
Table 2 lists these special characters and their uses as defined by CodeWatch.
^ (caret) Indicates that the regular expression immediately following this character
must be found at the beginning of the line.
* Matches any number of the character or pattern that immediately precedes it.
Find what For the current file, enter or select the text to search for. (You can
click the down-arrow to see a list of previous searches and repeat a
search by clicking in the list.)
Replace with Enter or select the text that is to replace each matched instance of the
search criteria specified in the Find what option.
Match whole word Match the search criteria specified in the Find what option only if the
only found occurrence is delimited by:
• spaces, tabs, or the beginning and/or end of the line, or
• any of the following characters:
\ “ ‘ ` ~ - = ! @ # $ % ^ & * _
( ) + [ ] { } | ; : . , < > / ?
For example, searching for “25” when this option is not selected will
match “1255” and “A25”. Selecting this option ensures that only
“25” is matched.
Match case When selected, find only the text that exactly matches the search
criteria. When not selected, uppercase and lowercase letters are
considered to be identical. Therefore, searching for ABC will match
“abc” and “AbC” in addition to “ABC”.
Regular expression When selected, specify that the search criterion is a UNIX-style
regular expression. This provides the ability to perform powerful
search and replace operations. For more information, see Regular
Expressions (on page 64).
Replace In Limit the scope of the Replace All operation (discussed below).
You can choose to replace all matching instances of the search
criteria specified in the Find what option in either the selection or the
entire file.
Find Next Find and highlight the next occurrence of the search criteria specified
in the Find what option in either the selection or the entire file.
Pressing F3, choosing Find Next from the Edit menu, or clicking the
Find Next toolbar button performs this same operation using the
current settings in the Replace dialog box, even if the Replace dialog
box is not open (or visible).
Find the previous occurrence of the text in the current file. If found,
the text is highlighted. Note that pressing Shift+F3, choosing Find
Previous from the Edit menu, or clicking the Find Previous toolbar
button performs this operation using the current settings in the Find
dialog box, even if the dialog box itself is not visible.
Replace Replace the currently highlighted instance of the search criteria in the
file with the replacement string. If you want to replace all
occurrences of the search criteria automatically, choose the Replace
All option.
Replace All Replace all instances of the search criteria in the file with the
replacement string. Compare with the Replace option.
Cancel Terminate the Replace dialog box without matching and cancel all
entries made in the dialog box.
Name Enter the name of the data item to be inspected or modified. You can
enter a simple name or an expression as described in the “Data
Address Development” topic of Chapter 9: Debugging of the
RM/COBOL User’s Guide.
Type Select or enter the type of the data item. Specifying <default>
displays the data item using the actual type of the data item. You can
cause the value of a data item to be displayed as a different type by
choosing a type from the drop-down list. See “Data Types” under the
“General Debug Concepts” section in Chapter 9: Debugging of the
RM/COBOL User’s Guide, for a description of allowed data types. In
the second illustration above, the HEX data type was selected to
show the binary data in INX-RECORD.
If the data item is a POINTER data type (PTR), then selecting a non-
PTR type from the Type list box causes CodeWatch automatically to
dereference the pointer. (An indirect reference is sometimes called a
dereferenced pointer.) To dereference the pointer, select the type of
the pointed-to data from the list. The pointer will automatically be
dereferenced to indicate that the displayed value was obtained
indirectly. The value will be displayed in green. If the pointer has
not been initialized, or the pointed-to memory cannot be accessed, an
error message is displayed in red.
To manufacture a pointer to a data item, select “&PTR” from the
Type list box. The value of a pointer to the specified data item will
be displayed in green. (An “address of” modified reference is
sometimes called a manufactured pointer.)
One use for this function is to copy the value to the Windows
Clipboard, and then replace the value of another pointer with the
contents of the Clipboard. To copy and paste this value, select the
text with the mouse and use the pop-up menu that appears when the
right mouse button is clicked in the Show text box.
Show (Button) Cause the current value of the data item to be displayed in the Show
text box (the area below the Show button). If the value is available,
that is, the data item is “in scope”, meaning the currently executing
program includes or contains the data item, the value will be
displayed in the Show box. If the data item is “out of scope”, or the
value cannot be displayed using the specified type, a message is
displayed in red.
Show (Box) Display the current value of the data item. If the value is available,
that is, the data item is “in scope”, meaning the currently executing
program includes or contains the data item, the value will be
displayed in the Show box. If the data item is “out of scope”, or the
value cannot be displayed using the specified type, a message is
displayed in red. Indirect references and addresses of references are
displayed in green. See “Data Address Development” in Chapter 9:
Debugging of the RM/COBOL User’s Guide, for more information
on the pointer data item.
Change Store any changes you made in the Show box into the data item, if
possible. This button is disabled if the value is a constant item.
Watch Add the data item to the list of watchpoints.
Note The CodeWatch main window menu bar and toolbar vary depending on whether or not
a program file has been opened and whether the program is running.
In the sections that follow, the toolbar buttons are illustrated with the corresponding menu
commands. The CodeWatch menus include the following:
• File menu (see the following topic)
• Edit menu (see page 74)
• View menu (see page 75)
• Build menu (see page 76)
• Run menu (see page 77)
• Window menu (see page 79)
File Menu
The File menu contains the following commands that operate on the current document, and on
the workspace as a whole. The corresponding shortcut key and toolbar button, if applicable,
are also shown.
File Menu
File Menu
File Menu
File Menu
File Menu
File Menu
Edit Menu
The Edit menu contains the following commands that operate on the current selection or the
object that currently has focus. The corresponding shortcut key and toolbar button, if
applicable, are also shown.
Edit Menu
Edit Menu
View Menu
The View menu contains the following commands. The corresponding shortcut key and
toolbar button, if applicable, are also shown. When these commands are selected, a check
mark () appears to the left of the menu option.
View Menu
View Menu
Breakpoints Tab Alt+1 Displays the Breakpoints tab (see page 52) in
the Data window.
Watchpoints Tab Alt+2 Displays the Watchpoints tab (see page 53) in
the Data window.
Data Files Tab Alt+3 Displays the Data Files tab (see page 54) in
the Data window.
Call Stack Tab Alt+4 Displays the Call Stack tab (see page 55) in
the Data window.
Build Results Alt+5 Displays the Build Results tab (see page 56) in
Tab the Data window.
Log Window Alt+6 Displays or hides the interactive debug Log
window (see page 58).
Data Item Shift+F9 or Displays or hides the Inspect/Modify dialog
Ctrl+I box (see page 66).
Program Output F12 If the RM/COBOL program is currently
running, reveals the RM/COBOL program
output window and gives it the input focus.
Preferences Alt+0 Displays the Preferences dialog box where
you can customize the behavior of the Source
Code/Edit window by using the Tabs tab (see
page 109) or the External Editing tab (see
page 111).
Build Menu
The Build menu contains the following commands. The corresponding shortcut key and
toolbar button, if applicable, are also shown.
Build Menu
Build Menu
Run Menu
The Run menu contains the following commands. The corresponding shortcut key and
toolbar button, if applicable, are also shown.
Run Menu
Step Program Alt+F8 Runs until the current program returns or exits.
The following functions are accessible from the Run | Breakpoint menu, the toolbar and the
keyboard, and are enabled only while a source code file is open in the Source Code/Edit
window.
Window Menu
The Window menu contains the following commands. For additional information, see also
Using Document Windows (on page 59).
Window Menu
New Window Ctrl+Z or Opens a new document window that displays the
Alt+Backspace same content as the current window. This command
is available only when using a Source Code/Edit
window (see page 97).
Cascade Cascades all document windows from left to right
and top to bottom in the client area of the frame of
the CodeWatch main window.
Tile Arranges all document windows so they are visible
in the client area of the frame of the CodeWatch
main window.
Window Menu
These tabs correspond closely to the pages in the CodeWatch Workspace wizard (see
page 35). The options available in the Workspace wizard pages are used to establish
properties when a workspace is being created, whereas the options available on the tabs in the
Workspace Properties dialog box allow you to change the properties of an existing
workspace. Each tab of the Workspace Properties dialog box is described in detail in the
following sections.
To open the Workspace Properties dialog box, do one of the following:
• From the File menu, choose Workspace | Properties.
• Click the Properties toolbar button.
• Press Ctrl+Shift+T.
Several buttons appear along the bottom of the Workspace Properties dialog box no matter
which tab is selected and displayed. They perform the same function or action on all the tabs
of the dialog box and are described below.
Program Tab
The Program tab of the Workspace Properties dialog box, illustrated below, allows you to
specify the name of the main program to run, modify a character set for the workspace, and to
define the execution environment for that program.
Program to Run Type or select the name of the COBOL program that CodeWatch is
to run. This can be one of the following:
• The filename of a COBOL object file (for example,
VERIFY.COB).
• The name of a COBOL program to be found in a COBOL library
(for example, VERIFY).
CodeWatch uses the RM/COBOL runtime to locate programs (see
the “Subprogram Loading” topic in Chapter 8: RM/COBOL Features
of the RM/COBOL User’s Guide, for a complete description of the
methods). For example, if VERIFY is specified as the program to
run, and VERIFY is not found in any configured library, then the
RM/COBOL runtime system will optionally search for a synonym for
VERIFY in the environment, and will then search for a file named
VERIFY.COB that contains exactly one separately compiled COBOL
program in the current directory, the PATH, and the RUNPATH.
CodeWatch does not attempt to resolve an ambiguous main program
name until execution begins.
This box may be left blank. If a main program is not specified, you
will be asked for the program name when you run the workspace.
Click the Browse button to open the Select a Program File dialog box
where you can search for and select a COBOL program file (.cob).
64-Bit When checked, the 64-bit runtime system will be used. The checkbox
is disabled and unchecked if only a 32-bit runtime system is installed,
and is checked and disabled if only a 64-bit runtime system is
installed.
Execution Directory Select the current directory that is used when the COBOL program
begins execution. Click the down arrow in the list box to choose
from a list of recently used working directories.
Click the Browse button to open a Select a Directory dialog box where
you can search for and select a working directory.
Workspace This read-only field is the root location of the workspace. For new
workspaces, this is initially the same location as the Execution
Directory, but is set to the directory that contains the workspace file
when the workspace is loaded or saved.
Whenever possible, the files in the workspace are processed using
this directory as a base directory. By saving the workspace into a
directory that contains all of your source files, COPY files, and object
files, those filenames can be stored as relative pathnames. This
makes workspace files portable between machines, and makes it
possible to check workspace .cwf files into version control systems..
Instrumentation When selected, enable instrumentation. This option is equivalent to
the /I Runtime Command Option.
Character Set Show the character set for this workspace. The character set is used
in the editor, during compilation, and during execution.
Two character sets are allowed:
• OEM/DOS
• ANSI/Windows
For a new workspace, the character set defaults to OEM/DOS after an
installation of RM/COBOL. The RMSETNCS utility may be used to
change the default character set for new workspaces to
ANSI/Windows.
After a workspace is created, the character set for that workspace
remains the same unless explicitly changed by the user. The default
character set for new workspaces can be overridden by specifying
one of the /cs_ansi or /cs_oem command line options when starting
CodeWatch.
To change the character set, click the Change button, which is
described in the next row.
Note For a detailed explanation of character sets within CodeWatch,
see Character Sets (on page 104). For further information about
character sets and the RMSETNCS utility in RM/COBOL, see
“Character Set Considerations for Windows” in Chapter 3:
Installation and System Considerations for Windows of the
RM/COBOL User's Guide.
Change Open the Select Character Set dialog box (see page 95) to change the
character set assumed for the workspace. The dialog box also allows
configuring the euro symbol for use in the CodeWatch editor.
Switches Set or clear the current set of runtime switches. The eight switches
are numbered consecutively from left to right. These options are
equivalent to the /S Runtime Command Option.
For a description of the buttons that appear along the bottom of this tab, see the Workspace
Properties Dialog Box (on page 66).
Options Tab
The Options tab of the Workspace Properties dialog box, illustrated below, allows you to
specify additional execution parameters.
Arguments to Main Enter arguments to be passed to the main program. This option has
Program the following format:
[delimiter]string[delimiter]
The delimiter character may be either a single or double quote, must
not appear within string, and is required only if string contains spaces
or tabs. If you enter a string that contains spaces, but do not use a
delimiter, CodeWatch will provide a delimiter or display an error if
no delimiter can be chosen. This option is equivalent to the /A
Runtime Command Option.
Overriding Select or enter the name of the primary runtime configuration file.
Configuration File This file completely overrides the default runtime configuration.
This option is equivalent to the /C Runtime Command Option.
If a relative path is specified, the path is interpreted as relative to
the directory specified in the Working Directory option on the
Program tab (see page 81).
Click the Browse button to open the Select a Configuration File
dialog box where you can search for and select a configuration
file (.cfg).
Supplemental Select or enter the name of the supplemental runtime configuration
Configuration File file. The contents of this file supplement the default runtime
configuration without replacing it. If an overriding configuration is
specified, the contents of this file supplement that configuration. If
no other configuration is specified, this file provides the complete
configuration. This option is equivalent to the /X Runtime Command
Option. If a relative path is specified, the path is interpreted as
relative to the directory specified in the Working Directory option on
the Program tab (see page 81).
Click the Browse button to open the Select a Configuration File
dialog box where you can search for and select a configuration
file (.cfg).
ACCEPT Buffer Size Enter the maximum buffer size to be used by ACCEPT and
DISPLAY statements. The maximum size is 65280 characters, and
the default size is 264 characters. This option is equivalent to the /B
Runtime Command Option.
Memory for Sort Enter the amount of memory (in bytes) to be used for a sort
operation. The default is 256000 bytes. Specify a larger value to
improve the efficiency of sort operations. Decrease this value to
allocate more memory for other data or called subprograms. If
neither SORT nor MERGE operations will be used in this run unit,
specifying 0 will free all reserved memory for other uses. This
option is equivalent to the /T Runtime Command Option.
Level 2 ANSI Semantics When selected, indicate that Level 2 ANSI semantics are to be used
for Format 1 ACC/DIS for Format 1 ACCEPT and DISPLAY operations. The default is to
use Level 1 ANSI semantics for these operations. This option is
equivalent to the /M Runtime Command Option.
Suppress Startup and When selected, suppress the banner message and the STOP RUN
STOP RUN Messages message. This option is equivalent to the /K Runtime Command
Option.
For a description of the buttons that appear along the bottom of this tab, see the Workspace
Properties Dialog Box (on page 66).
Environment Tab
The Environment tab of the Workspace Properties dialog box, illustrated below, allows you to
specify the execution environment for your RM/COBOL program. The Environment tab
contains five tabs. Click on a tab to set the parameters for the options available.
The following buttons appear on each of the tabs of the Environment tab and perform the
same function on each tab.
For a description of the buttons that appear along the bottom of this tab, see the Workspace
Properties Dialog box (on page 66).
Command Tab
The Command tab of the Workspace Properties dialog box, illustrated below, displays a text
box where you can view or edit the RM/COBOL Runtime Command line options.
RM/COBOL Runtime Display the command line that will be used to invoke the
Command Line RM/COBOL runtime, based on the current configuration on the tabs
in the Workspace Properties dialog box. Runtime Command line
options may be changed by appending, deleting, or overtyping text in
this text box. Any such changes will immediately be visible in the
other properties tabs, but will not be applied to the workspace until
either the OK or Apply button is pressed.
For a description of the buttons that appear along the bottom of this tab, see the Workspace
Dialog Properties Dialog Box (on page 66).
Program Select or enter the name of the program that contains the breakpoint.
Line Specify the number of the line that will cause a break to occur when
executed.
Stmt Specify the statement number within the line. Leave this blank to
indicate that the break will occur when the first (or only) statement on
the line is executed. Or, specify an offset: +1 indicates the second
statement on the line, and +2 indicates the third.
Remove the highlighted breakpoint from the list. The contents of the
text boxes are ignored.
List of Code Display a list of all code breakpoints in the current workspace. Each
Breakpoints breakpoint is preceded by a red circle. A solid red circle indicates
that the breakpoint is enabled; a hollow red circle indicates the
breakpoint is disabled. This is followed by the name of the program,
the line number, the statement number within the line, and the pass
number.
A disabled breakpoint can be enabled, and an enabled breakpoint
disabled by clicking on the red circle that precedes the breakpoint in
this list.
OK Apply all changes made to the list of breakpoints to the workspace
and close the dialog box.
Cancel Cancel the dialog box without saving changes.
Apply Apply all changes made to the list of breakpoints to the workspace
without closing the dialog box. Changes made with the Apply button
cannot be canceled by clicking the Cancel button.
Help Display help for this tab of the dialog box.
Data Item Enter the name of the data item being watched.
In/Of Data Item Specify qualification for the data item, if the name is not unique. The
sequence of names must form a valid qualified reference to a data
item, according to the rules for source program data references.
After typing a data item name, click this button to add the item to the
list.
Use the up and down arrow buttons to arrange and order the data
items in the list.
Click this button to remove a data item from the list.
Subscript Specify a list of decimal integer subscripts that specify the table
element to watch if Data Item is a table.
After typing a decimal integer subscript, click this button to add the
subscript to the list.
Use the up and down arrow buttons to arrange and order the
subscripts in the list.
Click this button to remove a subscript from the list.
The number of subscripts must match the number of OCCURS
clauses in the hierarchy of data description entries for the data item.
The value of each integer is interpreted as an occurrence number in
the same way as a literal subscript in the source program.
Ref Mod Offset Optionally specify a subfield of the data item. Offset is a decimal
and Length number with a value ranging from 1 to the length of the data item.
Length is a decimal number whose value ranges from 1 to the
remaining length of the data item, after Offset has been applied. If
Length is not specified, but Offset is specified, the length from offset
to the end of the data item is presumed.
Type Select the type of the watchpoint. This option is used to display the
value of the data item in the Watchpoints tab (see page 53) of the
Data window. If the data item being watched is a PTR data item, it is
possible to watch either the value of the PTR or the memory that the
data item points to. To watch the pointer’s value, select PTR from
the Type list. To watch the pointed-to memory, select “type” from
the list. For a description of allowed data types, see “Data Types”
under the “General Debug Concepts” section in Chapter 9:
Debugging of the RM/COBOL User’s Guide.
Add or change a watchpoint in the List of Data Watchpoints area.
Note To display the Item Properties dialog box by one of these methods when a Source
Code/Edit window is not open, you must first select a source or copy file on the Files tab of
the Workspace window.
Pathname Display the complete pathname of the currently selected source file.
Last Modified Display the date/time that the source file was last changed. This is
the same as the date of the file on the disk.
COPY Files Display a list of copy files that were included when this source file
was last compiled, including the name of the file and its location.
Source File Display the complete pathname of the currently selected source file.
Compiled Display the date/time that the source file was last compiled.
Programs Display a list of programs in the program file that were created when
this file was compiled. The name of the program file, the containing
library, and its location are available.
Source File Display the complete pathname of the currently selected source file.
Compiled Display the date/time that the source file was last compiled.
Build Options Display a list of the compilation options that were in effect the last
time this source file was compiled. For each compilation option, this
tab also specifies the default settings for the workspace and the
settings for this file. The columns in the table provide the following
information:
• Option. A description of the RM/COBOL compilation option.
• File. The setting for the currently selected file for each option.
• All. The setting for the workspace. This setting is used if the File
column is blank for a given option.
• Last Build. The setting that was used when the file was last
compiled. This setting is used if both the File and the All
columns are blank for a given option.
Change Setting For Change the setting in the column aligned with the button:
• File. Cycles the setting for the currently selected option between
the possible values for the option. You can press this button from
the keyboard by typing Alt+F.
• All. Cycles the setting for the currently selected option between
the possible values for the option. You can press this button from
the keyboard by typing Alt+A.
For options that have discrete values (such as a file or directory
name), a dialog box will appear to allow you to set the value.
Save Save the changes you made in this tab of the dialog box. Changes do
not take effect until you click this button.
Restore Restore this dialog box to its initial state, or to the point where you
last clicked the Save button.
For more information about using the options on this tab, see Setting Compilation Options (on
page 126).
OEM/DOS Select the OEM/DOS character set and enable the rest of the
Character Set dialog box.
ANSI/Windows Select the ANSI/Windows character set and disable the rest of the
Character Set dialog box.
Apply OEM/DOS Compensate for the fact that the OEM character set frequently does
RM Euro Correction not contain a euro character and allow an OEM code point to be
chosen that will be used to represent the euro. For OEM/DOS files,
this code point is translated to the specified ANSI code point when
the file is read into memory, and translated back when the file is
written back to disk.
Override OEM The code point value to use for the euro symbol in the OEM
Euro Code Point codepage. The value must be between 0 and 255. If the value is not
specified, CodeWatch will query Windows for the correct code point
to use. If the OEM codepage does not include a euro symbol (as is
true for most OEM codepages other than 858), CodeWatch will use
code point 213 (0xD5). This override is ignored if the Apply
OEM/DOS RM Euro Correction checkbox is not selected.
Override ANSI The code point value to use for the euro symbol in the ANSI
Euro Code Point codepage. If the value is not specified, CodeWatch will query
Windows for the correct code point to use. If the ANSI codepage
does not include a euro symbol, CodeWatch will use code point 128
(0x80). This override is ignored if the Apply OEM/DOS RM Euro
Correction checkbox is not selected.
The character set for the workspace can also be set by specifying /CS_OEM OR /CS_ANSI
on the CodeWatch command line.
For further details on character sets in RM/COBOL for Windows, see “Character Set
Considerations for Windows” in Chapter 3: Installation and System Considerations for
Windows of the RM/COBOL User's Guide.
The internal CodeWatch Source Code Editor displays the source code for the program that is
currently executing, if available, in the Source Code/Edit window. You can also edit the
source code in the Source Code/Edit window.
This chapter discusses the following topics:
• Locating Source Files During Execution (see the following topic)
• Contents of the Source Code/Edit window (on page 98)
• Using the Source Code/Edit Window (on page 101)
• Setting preferences (on page 109)
• Basic editing techniques (on page 114)
A Source Code/Edit window does not close automatically. Other than memory, there is no
limit on the number of Source Code/Edit windows that may be open at one time in a
CodeWatch main window.
Note Windows 9x-class operating systems may have difficulties if more than 100 Source
Code/Edit windows are open simultaneously. If performance decreases, close some of the
windows. Windows NT-class operating systems will not experience this problem.
The following sections describe the elements of the Source Code/Edit window and the
commands that are available from the context-sensitive menu that pops up when you right-
click a selected item in this window.
− A hollow circle to indicate that a breakpoint has been set on the current line, and the
breakpoint is temporarily disabled.
− A compiler-assigned line number. The line number is visible only if a program file
has been found for this source file.
• Text Area. This is the area where source code is displayed and edited. Compiler
diagnostic lines and lines included from copy files are also displayed in this area, and are
displayed in red to indicate that they cannot be changed.
CodeWatch uses color to make your program easier to read:
− Keywords and reserved words are displayed in black.
− Paragraph and variable names are displayed in blue.
− Comments are displayed in green.
− Text that cannot be edited is displayed in red.
− Quoted text strings are displayed in cyan.
− Numbers are displayed in magenta.
− During execution, the active statement is highlighted in yellow, and a suspended
statement (for example, one that issued a CALL) is highlighted in blue.
Note The Source Code/Edit window is an example of a document window. For more in-
depth information on how a document window works in CodeWatch, see Document Windows
(on page 59).
Watch Data Item Alt+F9 Adds the current selection or the word under
the cursor to the Watchpoints tab (on page
53) of the Data window.
Note that this information will also appear in
the List of Data Watchpoints area on the
Data Watchpoints tab of the Breakpoints &
Watchpoints dialog box (on page 87).
Character Map Ctrl+M Displays the Character Map dialog box.
This dialog box contains a grid that displays
all the glyphs that are available in the
currently selected font and character set
(also called a “script”).
This dialog box can be used to select a
different font and character set. For a
complete description, see Choosing an
Editor Font (on page 107). For further
discussion, see also Character Sets (on page
104).
A blank Source Code/Edit window will appear, containing an untitled document. The
document is not part of the workspace and is therefore not a COBOL source file until the file
is saved for the first time. At that point, the following dialog box is displayed:
The file can be given any valid name—it does not need to have a .cbl extension to be treated
as a COBOL source file. Instead, make sure Add to Workspace is checked and select either
COBOL Source File or COBOL Copy File, as required, and click Save.
Note Only COBOL source files that are part of the workspace may be compiled from
within CodeWatch.
Select a file from the list. Check Add to Workspace if the file is a COBOL source or
copy file and you would like to include the file in the workspace—in this case, be sure to
also specify the kind of file you are opening.
If a workspace is not open, the File | Open command defaults to opening a workspace.
To open a source file, pull down the Files of Type combo box and choose any option
except CodeWatch Workspace Files. The Add to Workspace options will be enabled.
Then, choose your file and select the proper type. A default workspace will be created
containing the selected file.
• Select an item in the Workspace window and select the File |Open Item command. You
can open the source for the selected item (which may itself be a source file) by right-
clicking on the item and choosing Open Item from the menu, or by selecting the item
and pressing the F2 (or open) key.
• Delete a selected region of text, or copy or cut a region to the Windows Clipboard.
• Paste text from the Windows Clipboard at the insertion point.
• Right-click to display a pop-up menu.
• Undo or redo one or more operations.
You can also perform the following non-editing operations in a Source Code/Edit window:
• Set a new breakpoint or clear an existing breakpoint by double-clicking in the indicator
column or on the line number. You can set, clear, enable, or disable a breakpoint by
right-clicking on a line and choosing the appropriate item from the pop-up context menu,
or by using buttons on the toolbar.
For a breakpoint to be effective, it must be set on a line that contains executable code.
Such lines are indicated by a small green dot in the gutter. Comment lines are not
executed; neither are the second or subsequent lines of statements that span more than
one line.
• Examine a data item during execution. To do this, highlight the data item in the Source
Code/Edit window by clicking with the mouse; then, double-click the selected item to
display the Inspect/Modify dialog box (on page 66). If the data item requires a subscript
or qualification, you can edit the name in the Inspect/Modify dialog box. The value of
the data item will be updated the next time the Debugger reaches a breakpoint or
watchpoint, or you can force the value to be refreshed immediately by choosing Break
from the Run menu, or by pressing F5. You can also add a watchpoint by clicking the
Watch button, or modify the data item by entering a new value and clicking the Change
button in this dialog box.
You can also set a watchpoint by right-clicking on a highlighted data item with the mouse
and choosing Watch Data Item or by pressing Alt+F9 from the pop-up menu. Note that
you cannot specify qualification or subscripts in this way, but you can edit the watchpoint
later to add this information.
• Search for a text string by doing one of the following:
− From the Edit menu, choose Find.
− Click the Find toolbar button.
− Press Alt+F.
You can search again by using the Edit menu and choosing the Find Next or Find
Previous command (or by pressing the corresponding toolbar buttons). As an alternative,
you can also use the shortcut keys. Press F3 to search forward or press Shift+F3 to
search backward in the file.
Character Sets
A codepage defines a mapping of character code points (often called bytes) to a set of
characters. CodeWatch initially uses the default character set contained in the Courier New
font to display and edit text. For systems installed in the United States and Western Europe
where the default codepage is 1252, this will be the ANSI character set (also referred to as
“Western” script or the Latin-1 code set). Systems installed in other locales will use the
default codepage for that locale.
However, many RM/COBOL programs were originally written for and executed under DOS.
The codepage/character set used by DOS programs is hardware-specific, and is frequently
referred to as the OEM/DOS 1 character set.
The difference between the ANSI and OEM character sets is not important if the COBOL
program uses only the 7-bit characters in the ASCII character set. The lower half of all
Windows-supported ANSI and OEM codepages, code points 000 – 127 (0x00 – 0x7F),
always match because they represent the same ASCII character set. The glyph (the visual
representation of a character) for these code points is the same in both the ANSI and OEM
character sets (and most others as well).
However, this is not true for code points above this range. The upper half of Windows ANSI
and OEM codepages, code points 128 – 255 (0x80 – 0xFF) can differ significantly in the
characters that particular code points represent. For example, Figure 1 illustrates the glyphs
displayed for code points 128 to 255 decimal when the Western character set in the Courier
New font is selected.
Figure 2 illustrates the glyphs displayed for code points 128 to 255 decimal (or 80 through
FF hex) when the OEM/DOS character set in the Terminal font is selected for an OEM
codepage 437.
In particular, note the highlighted first glyph in the first column (code point hex 80 or decimal
128). If a Western (ANSI) character set is being used to display this code point, it will appear
as a Euro glyph. However, if an OEM/DOS character set is being used to display this code
point, it will appear as a C-cedilla glyph. The combination of font and character set is critical
if non-ASCII text is to be displayed correctly.
Note While most Windows fonts contain more than one character set, to ensure that
characters entered into COBOL literals can be displayed by the RM/COBOL runtime,
CodeWatch allows only the default character set in each font to be selected for text editing.
An exception is made when using the OEM character set for a workspace; in this case, the
OEM/DOS script for a font, if it exists, may be selected.
If the source and copy files use only code points in the ASCII character set, that is, all code
points are in the range of 32 to 127 decimal, no further action is required. These code points
refer to the same characters in both ANSI and OEM codepages.
For code points outside of this range, there are two options:
1. If you know that the source files were created using the ANSI character set, you simply
have to choose a font that contains the correct character set for the current locale. The
default is normally just fine. Note that for ANSI workspaces, you must choose a font that
defaults to an ANSI character set (this includes most Windows fonts). You cannot
choose a font that defaults to the OEM character set. It is not required that the default
character set be “Western”—it can be any non-OEM character set.
2. If the source files were created with the OEM/DOS character set (which is often the case
for legacy projects originally developed for DOS), you should declare that the workspace
uses OEM/DOS files. In this instance, CodeWatch will translate the characters from
OEM/DOS to ANSI when they are loaded into the editor, and will translate them back
from ANSI to OEM/DOS when the file is rewritten. This translation process is bi-
directional: if you choose an ANSI font, not all OEM glyphs will display correctly
(ANSI fonts do not contain line-drawing glyphs), but the glyphs will be preserved and
not altered unless you choose to overtype them.
To ensure that all OEM/DOS characters are visible in the editor, you should choose to
edit with a font that contains an OEM character set. CodeWatch will normally allow you
to edit only with the default character set in a font, but this rule is relaxed for OEM
character sets—the Character Map dialog box allows you to choose any font that contains
an OEM character set. Please be aware that not all these fonts are available to running
COBOL programs.
Script Restrict the list of fonts to those that contain a specific character
script or character set.
On Windows, fonts can contain multiple character sets, but not all
fonts contain every character set. CodeWatch offers a set of fonts
and character sets appropriate for either the ANSI or the OEM mode
of the workspace. The Script dropdown list allows you to see all
valid fonts, or just those that contain a particular script.
• If the workspace mode is OEM, you will see a list of all fonts that
use OEM as the primary character set, those fonts that provide an
OEM character set (even if it is not the primary character set),
and those fonts that use ANSI as the primary character set.
• If the workspace is ANSI, you will see a list of all fonts that use a
non-OEM character set as the primary character set. You will not
see OEM fonts.
Selecting All from this box lists all the fonts that may be used in the
workspace.
Character Grid Display the character glyphs for each code point in the selected font
and character set. This is the font and character set being used in the
editor only if the Use in Editor check box is selected.
By default, the code points that have ordinal values between 128 and
255 (or 80 and FF hex) inclusive are displayed. To display code
points between 0 and 127 (or 0 and 7F), inclusive, click the
appropriate button at the bottom of the grid.
Code points that are actually being used in the file that is being edited
are highlighted.
To see the code point of a particular glyph, hover over the code point
with the mouse. The title bar of the dialog box will display the
hexadecimal value of the code point and the Alt key combination that
will insert this code point into the text editor. For example, using the
Courier New font and the OEM/DOS character set (as in the example
above), hover over the degree symbol in row A0 and column 7. The
title bar will change to the following:
Character Map: 0xA7 (Alt+0167)
To insert this character in the editor, close the Character Map dialog
box to return to the editor. Then hold down the Alt key and press
0167 on the numeric keypad. Finally, release the Alt key. The
degree symbol ° will appear at the cursor position.
Note that the code point of each symbol may vary depending on the
character set.
Use in Editor Use the currently selected Font and Size combination in the editor.
When the Character Map dialog box is first displayed, the currently
selected font and size are displayed and the check box is selected.
The box is automatically unchecked if a different font or script is
selected, but not if a different font size is selected. If this check box
is selected when you press the OK button, the currently selected font
and size will be used for editing.
OK Click this button to optionally change the font face name and size in
all open editors. Note that the change is applied only if the Use in
Editor check box is selected.
Cancel Close the dialog box without changing the font face name and font
size in the editor.
Notes
• Only fixed-pitch fonts can be used in the editor.
• Changing the font face name and font size affects all open editors immediately.
• External editors are not affected by any of the discussion regarding character sets (see
page 104). For a workspace with an OEM character set, only an external editor that uses
the OEM codepage should be used. For a workspace that uses the ANSI codepage, only
an external editor that uses the ANSI codepage should be used. For information on
setting an external editor, see External Editing tab (on page 111).
Setting Preferences
The behavior of the Source Code Editor can be customized and controlled by using the
Preferences dialog box.
Tabs Tab
The Tabs tab, illustrated below, allows you to specify the way CodeWatch expands tab
characters when displaying a file in the Source Code/Edit window and determines how the
CodeWatch Source Code Editor behaves when the Tab key is pressed on the keyboard in
Insert mode.
Tabs Tab
Tab Character Select how CodeWatch expands tab characters when displaying a file
Expansion in the Source Code/Edit window.
• Every 8 Columns. Selecting this option indicates that a tab
character causes the cursor to advance by 1 to 8 spaces so the
next character is displayed on an 8-character boundary. This is
the standard interpretation of tabs by DOS and by many UNIX
systems and is the default setting.
• Every 4 Columns. Selecting this option indicates that a tab
character causes the cursor to advance by 1 to 4 spaces so the
next character is displayed on a 4-character boundary.
Right Margin after Like the INITIAL-MARGIN-R configuration option, this value
Column specifies the position of the default right margin. This position
determines the end of the program-text area and the beginning of the
Identification area, if any. See the explanation of fixed-form reference
format in the RM/COBOL Language Reference Manual for more
information on margin R. The value for this keyword is a number
specifying the column after which margin R is located. The minimum
value is 72 and the maximum value is the same as the maximum source
record length.
Margin R can also be changed at any time during the compilation with
the RM/COBOL implementer-defined directive IMP MARGIN-R.
Use Default Right Uses the default values for the above fields. Uncheck this box to
Margin and Record customize the maximum record length and the right margin.
Length
Pathname of Program Specify the full pathname of the external editor program to invoke.
This should be the complete pathname of the executable file, but can
also be the name of a DOS .bat file, if you are invoking a DOS-based
external editor. Click the ellipsis button to display a Select Editor
Program File dialog box in order to search for a program.
Note An external editor has its own character set conventions. Care
should be taken in choosing the external editor so that its character set
matches the workspace character set.
Command Line Specify the command line to be passed to the external editor. The
Parameters contents of this field will depend on your chosen editor. Various
substitution symbols are available to pass the current context (file,
cursor line, and position) to the external editor. Press the arrow button
to display a submenu of substitution symbols. Available symbols
include the following:
• $(SFP) The pathname of the current source file.
• $(SFN) The current source filename and extension.
• $(SFD) The directory that contains the current source file.
• $(SFE) The extension of the current source file, including the
period.
• $(CL0) The line number containing the cursor, where 0 is the first
line.
• $(CC0) The column number containing the cursor, where 0 is the
left-most column.
• $(CL1) The line number containing the cursor, where 1 is the first
line.
Working Directory Specify the working directory that is set for the eternal editor. Leave
this field blank to use the directory where CodeWatch is running. Press
the arrow button to display a submenu of substitution symbols.
Available symbols include the following:
• $(CWD) The current working directory. This is the default.
• $(EWD) The current “execution” directory, as specified in the
Inspect/Modify dialog box (see page 66) when you choose
Workspace | Properties command from the File menu.
• $$ A single “$” symbol.
Autosave File Determine how CodeWatch behaves when you invoke an external
editor on a file that you have changed, but not saved. If this option is
selected, the file is automatically saved. When this option is not
selected, the file is not automatically saved, and CodeWatch will
present the following prompt in a message box:
This file has been edited but
has not been saved. Save it now?
Choose Yes to save the file and start the external editor. Choose No to
start the external editor without saving your changes. Choose Cancel to
return to CodeWatch without invoking the external editor.
Autoreload File Determine how CodeWatch behaves when you return to CodeWatch
from another application. This applies whether you are returning from
an external editor or from any other program. If this option is selected,
CodeWatch will automatically reload any file open in the external
editor that has been changed outside CodeWatch, but only if there are
no unsaved changes.
If this option is not selected, and you return to CodeWatch after making
changes to a file outside CodeWatch, you will see the following
message box:
The file "filename.cbl" was modified outside CodeWatch.
Would you like to reload this file?
Choose Yes to reload the file, and choose No to keep working without
reloading the file.
If this option is selected, and you return to CodeWatch after making
changes to a file outside CodeWatch and you have not changed the file
within CodeWatch, the changes will automatically be loaded into the
CodeWatch Source Code Editor. If, however, you have made changes
in CodeWatch, you must choose which set of changes to keep. The
following message box will appear:
The file "filename.cbl" was modified outside CodeWatch, and
there are also unsaved changes in the CodeWatch editor.
Would you like to reload this file and lose any changes you
made since the last time this file was saved?
Choose Yes to reload the file and discard your changes. Choose No to
continue working in CodeWatch.
Note In either of the above cases, you can choose No, and then use the
Save Copy As command from the File menu to save a copy of the
version of the file in the CodeWatch Source Code Editor. You can then
close and reopen the file to load the new version.
OK Apply any changes made above and close this dialog box.
Cancel Close this dialog box without saving changes.
Apply Apply changes without closing the dialog box. Changes made with
the Apply button cannot be canceled by clicking the Cancel button.
Miscellaneous Tab
The Miscellaneous tab, illustrated below, allows you to configure several options:
Reset All Hidden Some CodeWatch warnings have an option to suppress future
Warning Messages messages. To see these again, check the box and press the OK or
Apply button.
Window Style Determines how the document window functions. Select the
Workbook Style to use tabs across the bottom of the window, which is
preferred but takes up some space in the window. Select Traditional to
use the standard MDI style. In either style, a list of open document
windows is added to the bottom of the Window menu, and this (or
Alt+Tab) can be used to move between Windows.
Windows can be cascaded, tiled, or split when either window style is in
effect.
Compiler Search Determines whether the 32-bit or 64-bit compiler will be used to build
Order the workspace. Available options are:
You may also find it helpful to refer to the mouse and keyboard techniques, as described in
How to Move with the Mouse (on page 117) and How to Move with the Keyboard (on
page 117).
Insertion Point
The insertion point indicates your current position in the file. The insertion point on the status
bar in CodeWatch is referred to as the “Edit point.”
The visual appearance of the insertion point corresponds to the type of text-entry mode:
Insert mode, Overtype mode, and Selection mode. You are in Selection mode when you
select one or more characters by dragging the mouse or using the keyboard. In all other cases,
you are in Insert or Overtype mode. The Ins (Insert) key toggles between Insert mode and
Overtype mode. An indicator on the status bar is blank when you are in Insert mode, and
indicates OVR when you are in Overtype mode.
For more details on the appearance of the insertion point and these three text-entry mode
options, see Selecting Text (on page 118).
You can move the insertion point anywhere within the text of a line on the screen by
positioning the I-beam mouse pointer to the desired location and clicking the left mouse
button. You can also move the insertion point using the direction keys on the keyboard, as
described in Table 3 on page 117.
Note There is one essential difference between using the direction keys on the keyboard to
move or page through a file and using the mouse to move or scroll through a file. When you
use the keyboard, the insertion point will travel with you as you move through the file. When
you use the mouse, however, the insertion point does not change location and remains where
it was before you moved. For example, if you use the mouse to view another part of your file
and then start entering text, CodeWatch returns you to your starting place and anything you
have typed is entered at the original insertion point location.
To move through your file one line at a time, click on the scroll arrow at the top or bottom of
the vertical scroll bar. Click the bottom arrow to scroll down—or forward—through a file
and the top arrow to scroll up—or backward. To move through a file one full screen at a time,
click anywhere within the scroll bar—above the scroll box to scroll up, or below the box to
scroll down. You can also quickly and continuously scroll forward and backward through a
file by clicking and holding down the mouse button over the scroll arrow.
To move long distances through a file, you can drag the scroll box to the appropriate position
in the scroll bar. The scroll box position on the vertical scroll bar represents your relative
position in the document.
If you are working with a file that is too wide to fit on the screen, you can use the scroll
arrows at either end of the horizontal scroll bar to move right and left. Horizontal scrolling is
much like vertical scrolling. Use the scroll arrows to move short distances, click on either
side of the scroll box to move by a full screen, or drag the scroll box to reposition the window
manually.
To the first non-blank character of the current line, or the beginning Home
of the current line.
To the end of the current line (to the first trailing blank). End
To the next word that matches the word under the cursor. Ctrl+F3
To the previous word that matches the word under the cursor. Ctrl+Shift+F3
Selecting Text
Before you can edit a given portion of text, you first have to select it. When you select text,
the CodeWatch Source Code Editor enters Selection mode, and the insertion point is
displayed highlighting the selected text in reverse video (white text and graphics on a black
background rather than the normal black on white).
Note Throughout this user’s guide, this reverse video effect is referred to as selected text or
highlighted text.
You can select one or more characters of text in order to edit the entire selection as a single
unit. To cancel a selection (and return to Insert or Overtype mode), position the I-beam
mouse pointer outside the selected text and click the mouse button, or use any of the direction
keys described previously in Table 3. See also Inserting New Text (on page 121) and
Overwriting or Replacing Text (on page 121).
You can select text in many ways using the mouse or the keyboard. Each approach offers its
own advantages.
Selecting a Word
To select an entire word, hold down the Ctrl key, and single-click in the word. The entire
word will be highlighted. Pressing Shift+Ctrl+W has the same effect.
Double-clicking also selects a word. In addition, if the program is running, the
Inspect/Modify dialog box (see page 66) is displayed and the word is displayed as if it
were an identifier.
To select a single line, click in the gutter to the left of the line of text. The entire line will be
highlighted. Dragging the mouse in the gutter selects multiple lines.
To select multiple lines, position the I-beam mouse pointer and drag the insertion point so that
text from at least two lines is selected.
To select the entire document, hold down the Ctrl key and click in the gutter, choose Select
All from the Edit menu, or press Ctrl+A anywhere in the file.
To select one or more characters, position the I-beam mouse pointer and drag over the desired
text. Begin by positioning the I-beam mouse pointer just to the left of the text you wish to
select. Press and hold down the left mouse button, and without releasing the button, drag to
the right until you have highlighted the desired text. Release the mouse button. The
characters will remain highlighted. You can use dragging to select any size block of text,
from a single character to an entire file.
Similarly, dragging in the gutter will select more than one entire line.
Block Selection
To select a rectangular block of text, hold down the Alt key, and click in one corner of the
selection. While holding down the mouse key, drag the mouse to the opposite corner (it need
not be in the window—the Source Code/Edit window will scroll if necessary). All text in the
rectangle will be selected.
Extending a Selection
To extend a selection, hold down the Shift key while dragging with the mouse.
• To select all text between the cursor and another location on the screen, hold down the
Shift key and click with the mouse. All text between the cursor position and the point
where the mouse was clicked will be selected.
• If text is selected, you can reshape the selection by holding down the Shift key and
clicking with the mouse. All text between the origin of the selection and the location
where you clicked will be selected.
To the end of the current line (to the first trailing blank). Shift+End
Deleting Text
The easiest way to delete a character is to place the insertion point to the right of the character
and press Backspace. CodeWatch will delete one character to the left of the insertion point,
pulling characters at the right of the insertion point one space to the left. If you prefer, you
can place the insertion point to the left of the character you want to delete and press Del. In
this case, CodeWatch will delete the character to the immediate right and move all following
characters to the left.
To delete several characters at once, you can select (or highlight) them and then press either
Backspace or Del (Delete). CodeWatch will delete the selection and fill in the gap by pulling
the remaining text in the Source Code/Edit window up and to the left. You can also delete
text with the Cut command from the Edit menu. See Cutting, Copying, and Pasting Text (on
page 123).
Keyboard shortcuts are also available for deleting text. For example, instead of pressing
Backspace to delete characters one at time, you can press Ctrl+Del to delete the word
containing the cursor. Table 5 describes these editing shortcut keys.
Editing Keys
To In This Mode Press
Replace the selected lines with a blank line if one or more Selection, Insert Enter
lines are selected. If only part of a single line is selected,
delete the selected characters and split the line at the
insertion point.
Delete the selected text and move to the first non-blank Selection
character on the next line.
Split the line at the insertion point. Insert
Move to the first non-blank character on the next line. Overtype
Delete all text from insertion point to the end of the line. All Ctrl+Del
If the insertion point is within a word, delete from the All Ctrl+Del
beginning of the word to the beginning of the next word.
If the insertion point is not within a word, delete from the
insertion point to the beginning of the next word.
Editing Keys
To In This Mode Press
Shift the text from the insertion point to the end of the line All Tab
right to the next tab stop by inserting blanks in the vacated
positions.
Note If the selection encompasses more than one line, all
lines in the selection are shifted. This is a convenient way
of indenting a block of code.
Shift the text from the insertion point to the end of the line All Shift+Tab
left to the previous tab stop, provided there are no non-
blank characters between the insertion point and the
previous tab stop.
Note If the selection encompasses more than one line, all
lines in the selection are shifted. This is a convenient way
of unindenting a block of code.
Next, position the insertion point in the destination (or target) file and do the following:
• Choose Edit | Paste or press Ctrl+V or Shift+Ins to insert the selected text. You can do
this any number of times.
Only one Clipboard is available to all Windows programs, so any cut or copy operation in any
program will replace the contents of the Clipboard.
Compiling
There are several ways to compile a file under CodeWatch.
Compiling
All files that have changed since the last Compile Changes on the
compilation or that have out-of-date Build menu or press F7.
object files. The source files that will be Compile
compiled are indicated by a checkmark Changes
on the Files tab in the Workspace
window. For further information, see
Files tab (on page 49).
All source files in the workspace. Compile All on the
Build menu or press
Ctrl+Shift+F7. Compile All
• A copy file used by the source file has been edited since the last compilation. This is
determined by comparing the date of the copy file to that of the object file. If the copy
file is newer than the object file, recompilation is required.
• An RM/COBOL compilation option has been changed in the workspace that affects the
generated program. This includes any of these Compile Command Options: /D, /G, /H,
/N, /O, /Q, /S, /U, /V, /Y, /Z, /2 and /7.
For a description of the options on this tab, see Build Options property tab (on page 93).
Note that CodeWatch will recommend that a file be recompiled under the following
circumstances:
• The setting in the File column is not blank and does not match the setting in the Last
Build column.
• The setting in the File column is blank (that is, not specified), the setting in the All
column is not blank, and that setting does not match the setting in the Last Build column.
In other words, the File setting has the highest priority, and the All setting has the second
highest priority.
Table 7 lists the RM/COBOL Compile Command Options that can be set in the Build
Options property tab of the Item Properties dialog box. (For more information on the
RM/COBOL compilation options, see Chapter 6: Compiling of the RM/COBOL User’s
Guide.)
Note the following:
• A check () in the Dep? (Dependent) column indicates that a change to this option
will mark the source file for recompilation.
• The Default Value column indicates the value that will be used if this option is not
specified.
• Italics (for example, Numeric Value) indicate that you will be prompted to enter
this value.
• If you select conflicting options (for example, both B=Yes and V=Yes or 2=Yes
and 7=No), CodeWatch will issue a warning and require that the error be corrected.
Note For more information on the RM/COBOL compilation options, see Chapter 6:
Compiling of the RM/COBOL User’s Guide.
To rearrange the order of the directories, you can drag entries with the mouse, or use the
Move Up and Move Down buttons.
Compilation under CodeWatch is also affected by the contents of the Environment tab.
Synonyms may be assigned using this tab, and any of the environment variables described in
Chapter 2: Installation and System Considerations for UNIX and Chapter 3: Installation and
System Considerations for Windows of the RM/COBOL User’s Guide, may be set in this way.
To resolve this problem, reinstall the RM/COBOL compiler. You can also try to reregister
the server:
• Open a command window.
• Change into the directory where you installed the compiler. By default, on 64-bit
Windows systems, this is:
For more information about registering the compiler and runtime executables, see
Chapter 3: Installation and System Considerations for Microsoft Windows of the RM/COBOL
User’s Guide.
Compiler Output
When one of the Build commands is given, CodeWatch takes the following actions:
• The Log window is cleared.
• The Build Results tab in the Data window is cleared.
• You are asked to save any files that are about to be compiled and are being edited, and
that have been changed since they were last saved or opened.
• Each file in the list of files that are awaiting compilation is compiled, using the options
that are currently set for that file and for the workspace.
− The output of the compiler is sent to the Log window.
− As each file is compiled, the results are also logged into the Build Results tab of the
Data window.
• If a file is open in the editor, the file is reloaded and merged with listing information from
the program file.
• Files with errors or warnings are highlighted in the Build Results tab of the Data window.
Appendix A: Additional
Configuration Options
CodeWatch includes several configuration options and tuning parameters that are not set from
within the program. Instead, these options are read from a file called rmcw.ini. This file is
created in the current user’s application data directory when CodeWatch is run for the first
time. The rmcw.ini file can be edited with any text editor, including the CodeWatch Source
Code Editor. To edit this file in CodeWatch, choose Open from the File menu and enter
%APPDATA%\Micro Focus\RM\CodeWatch\rmcw.ini.
WARNING The rmcw.ini file contains other keys that are not described below. These keys
are for internal use only, and their values should be altered only under the guidance of Micro
Focus Customer Care.
Runtime Options
The configuration settings for several RM/COBOL Runtime Command Options are discussed
in the following topics.
[Defaults]
RuntimeRegistryKey=key
This value is read whenever the RM/COBOL runtime is started from within CodeWatch. If
not specified, runcobol is used as the key.
[Defaults]
RuntimeConfigurationEXE=program-file
If such a configuration .exe file is specified, the name of the file is also used as the default
registry key unless the RuntimeRegistryKey option is specified. (For more information, see
Setting the RM/COBOL Runtime Registry Key on page 131.) The directory containing the
.exe file is used to locate the runtime license vault unless the RuntimeLicensePathname option
is specified, as described in the following topic, Selecting a Runtime License Vault.
[Defaults]
RuntimeLicensePathname=directory
Compiler Options
The configuration settings for several RM/COBOL Compile Command Options are discussed
in the following topics.
[Defaults]
CompilerRegistryKey=key
This value is read whenever the RM/COBOL compiler is started from within CodeWatch. If
not specified, rmcobol is used as the key.
[Defaults]
CompilerConfigurationEXE=program-file
If such a configuration .exe file is specified, the name of the file is also used as the default
registry key unless the CompilerRegistryKey is specified. See the previous topic, Setting the
RM/COBOL Compiler Registry Key (on page 132).
[Defaults]
CompilerSearchOrder=0
Miscellaneous Options
The configuration settings for several miscellaneous options are discussed in the following
topics.
[Defaults]
LogFont=font[,size]
The following example illustrates how you can use this option to change the default font to
Lucida Console, 9 point, which would allow more lines to be displayed in the Log window:
LogFont=Lucida Console,9
In order to see this change, however, you must close and reopen the Log window.
[Defaults]
MaxLogLines=value
[Defaults]
IdleCheckDependencyCount=value
Reducing this value may make CodeWatch more responsive when switching windows, but it
should not have an effect during normal operations.
Appendix B: Summary of
Enhancements
This appendix provides a summary of the new features and changes in the various releases of
CodeWatch. The enhancements and changes for the most recent release described by this
document are listed first.
Note The information in this appendix is historical. It was accurate at the time written for the
specific version being described. Various features may have changed in later releases, and,
possibly, some features may have been removed.
Version 12 Enhancements
Version 12 of CodeWatch complies with the RM/COBOL 12 release level.
Note CodeWatch version 12 will operate only with the version 12 RM/COBOL compiler and
runtime system. However, RM/COBOL programs that are compiled with previous versions
of the development system do not need to be recompiled in order to be used in CodeWatch.
Both CodeWatch and the RM/COBOL version 12 development system will coexist with
earlier versions on the same machine as long as the installation directories are different.
The other major enhancements in version 12 of CodeWatch include the following:
• CodeWatch now has the ability to debug service programs running under Xcentrisity
Business Information Server (BIS) on an IIS web server. The IIS server can be local
(that is, on the machine hosting CodeWatch), or remote and text files (for example, server
response files) can be edited on the server from within the CodeWatch environment. For
more information, see the CodeWatch for Xcentrisity Business Information Server User’s
Guide Supplement.
Note Remote compilation and deployment are not supported in this version.
• Filenames and pathnames in saved CodeWatch Workspace Files (that is, in .cwf files),
are now stored as relative paths that are based on the directory that contains the saved
workspace. As long as the files that make up the workspace can be located relative to the
saved workspace file, this enhancement makes it possible to XCOPY a directory tree
between workstations, check out a CodeWatch workspace from a version control system,
or load a CodeWatch workspace over the network without adjusting pathnames.
• CodeWatch compatibility with Windows Vista and Windows Server 2008 has been
improved. The RMCW.INI file is now stored in the
Version 11 Enhancements
Version 11 of CodeWatch complies with the RM/COBOL 11 release level and contains fixes
for numerous minor problems. This is the first version of the product to support use on the
Microsoft Windows Vista operating system.
Version 10 Enhancements
Version 10 of CodeWatch complies with the RM/COBOL 10 release level. This version of
CodeWatch also contains the following enhancements:
• The CodeWatch source code editor now has the ability to show and hide COPY files. By
default, COPY files are now hidden, making source code editing and navigation faster. A
hidden COPY file is denoted by a [+] symbol in the right margin of the source edit
window. The hidden COPY file text can be revealed by clicking on the [+] symbol, and a
revealed COPY file block can be hidden by clicking on the [-] symbol in the margin. In
addition, the F11 key toggles the block that contains the cursor, and the View menu and
the editor popup menu contain menu picks to perform these operations, and reveal and/or
hide all COPY file blocks in the current file.
Note that Find command on the Edit menu will search only visible COPY file blocks. To
search all COPY blocks, use the View | Copy Files | Expand All Blocks command.
• Double-clicking in the leftmost column now sets or clears a code breakpoint on that line.
• The File menu contains options to print the current source. The entire source or simply a
selected portion of the source can be printed.
• CodeWatch displays a tab containing the name of each open file or window at the bottom
of the document area. Clicking on the tab for a particular window brings that window to
the top. This is called “workbook” mode, because the document area has the appearance
of a binder. The previous mode can be selected with the "Settings" tab in the View |
Preferences dialog box. This feature may also be referred to as “tabbed edit windows.”
• CodeWatch can load large projects and save large source files much faster than in
previous versions.
This release of CodeWatch also includes fixes for numerous minor problems such as the
problem of the system crash caused by double-clicking the Build button, and the failure to
restore watchpoints with subscripts when loading a saved workspace.
Version 9 Enhancements
Version 9 of CodeWatch complies with the RM/COBOL 9 release level and contains fixes
for numerous minor problems. This version of CodeWatch also contains the following
enhancements:
• Dependency checking is more complete. COPY file timestamps are now checked and
dependency checking is more efficient overall.
• The time required to load large workspaces—that is, workspaces that contain a very large
number of source and COPY files has been greatly reduced.
• Improved file loading performance for very large source files, especially when those files
contain a large number of COPY file lines. Compilation performance has been
improved, also. A progress indicator is displayed on the status bar during long
operations.
• Full support for the RM/COBOL compiler ANSI/OEM switches:
1. Workspaces are now declared to use the OEM or ANSI character sets. This selection
is a workspace property and affects the editor, compiler, and runtime. The default is
the character set chosen when the version 9 development system or runtime system
was last installed.
2. Previous versions of CodeWatch made no assumptions about the set of characters
used in source files, which could cause OEM character sets to be displayed
incorrectly.
3. CodeWatch recognizes and uses the new /cs_ansi and /cs_oem runtime command
line options.
4. For OEM workspaces, CodeWatch allows the “RM Euro Codepoint” to be specified.
This is useful when choosing a font that does not contain the Euro character as the
default font.
For more information, see Character Sets (on page 104).
• A new dialog box is available from the Edit menu (see page 74). The Character Map
dialog box displays a grid of characters in the currently-selected character set and also
indicates the characters used in the file that is currently being edited. This is useful for
editing programs that contain non-ASCII characters.
This dialog box also allows the font face name and font size to be chosen. CodeWatch
allows a font to be chosen for OEM mode and a separate font to be chosen for ANSI
mode. In OEM workspaces, fonts that contain an OEM or default to the ANSI character
set, may be used. In ANSI workspaces, only fonts that use the ANSI character set may
be used. For a complete description of this dialog box, see Choosing an Editor Font (on
page 107).
For further information, see Character Sets (on page 104).
• The runtime –V (verbose) and –F (fill character) command line options are now
recognized.
• CodeWatch now uses Windows XP Visual Styles.
• Educational and Evaluation versions of the RM/COBOL development system are now
supported.
• Numerous minor problems have been corrected (such as the problem of the system crash
caused by double-clicking the Build button).
Version 8 Enhancements
Version 8 of CodeWatch includes several defect corrections, and the product complies with
the RM/COBOL 8 release level.
Index
Build Options property tab, Item Properties dialog
box 93
Build Results Tab command (View) 76
Build Results tab, Data window 56, 130
C
Call Stack Tab command (View) 76
Call Stack tab, Data window 55
Canceling a selection 119
Character Map dialog box 75, 101
Character sets 8, 39, 75, 83, 101, 104, 112, 138
Clear All command (Run | Breakpoint) 79
Clear command (Run | Breakpoint) 79
- (minus sign) 47
Clipboard
cutting, copying, and pasting text onto 123, 124
$ using with selections 124
with the Edit menu commands (Source Code/Edit
$ (dollar sign) 113
window) 121, 123
Close button 61
+ Close command 61, 69
Code See Source code
+ (plus sign) 47
Code Breakpoints page, Breakpoints & Watchpoints
dialog box 29
A Code Breakpoints tab, Breakpoints & Watchpoints
All caps, as a document convention 3 dialog box 88
Angle brackets, in program names 24, 27, 48 code points 104
Animate button 28, 78 codepage 104
Animate command (Run) 28, 78 CodeWatch
Animating the program 28, 78 animating the program 28, 78
ANSI 8, 105, 138 changing the workspace 33
Attach Configuration utility (rmattach) 132, 133 character sets 8
compiling 76, 93, 125
configuration 131
B configuring a workspace 20, 35
Bold type, as a document convention 3 configuring initialization file (rmcw.ini) 131
Break command (Run) 78 enhancements 1, 135
Breakpoint command (Run) 78, 79 features, new 135, 137, 138
Breakpoints inspecting and modifying data 31, 66
changing 52, 88 installation 7
deleting 52, 88 license, runtime system 132
disabling 52 main window, described 43
displaying (viewing) 52, 76 overview 11
enabling 52 rmcw.ini file, configuring 131
setting 29, 88 running the program 25
Breakpoints & Watchpoints dialog box 87 saving a workspace 33
Code Breakpoints page 29 setting
Code Breakpoints tab 88 breakpoints 29, 52, 75, 76, 88
Data Watchpoints page 31 watchpoints 30, 53, 75, 76, 89
Data Watchpoints tab 89 starting 17
Breakpoints command (Edit) 75 stopping the program 32
Breakpoints Tab command (View) 76 system considerations 7
I M
Icons, used in Workspace Main window, CodeWatch 43
window 47 Maximize button 61
Initialization file (rmcw.ini), configuring 131 Maximize command 61
Insert Items command (File) 71 Menu bar and menus 44, 68
Insert mode 121 Minimize button 61
Insertion point 116 Minimize command 61
Inspect/Modify dialog box 31, 66 Minus sign (-) 47
Installation 7 Mouse
Installation and system considerations 7 basic techniques
Introduction page, Workspace wizard 36 scrolling with 117
Italic, as a document convention 3 selecting text 119
Item Properties command (File) 72
Item Properties dialog box 91
N
Build Options property page 126
Build Options property tab 93 New command (File) 69
Programs property tab 93
Source File property tab 92
O
Options tab, Workspace Properties dialog box 83 Runtime Command line options 87
Organization of this guide 2 Runtime license 132
Overtype mode 121 Runtime registry key, configuring 131
RuntimeLicensePathname option 132
P
S
Paste command (Edit) 75
Source Code/Edit window 123, 124 Save As command (File) 70
PATH environment variable 23, 38, 42, 82, 86 Save command (File) 70
Plus sign (+) 47 Save Copy As command (File) 70
Pointer data items 67, 91 Saving a workspace 33
Preferences dialog box 109 Scroll bars 117
External Editing tab 111, 112, 114 Scrolling 117
Tabs tab 109 Search string characters 63
Program files 20, 49 Select All command (Edit) 75
Program Output command (View) 76 Select Character Set dialog box 95
Program tab, Workspace Properties dialog box 81 Selecting
Programs property tab, Item Properties dialog box 93 with the keyboard 120
Programs tab, Workspace window 48 with the mouse 119
Properties Selecting text 119
item 91 Selection mode 119
workspace 80 Set Additional Options page, Workspace wizard 22,
40
R Set command (Run | Breakpoint) 79
Set Environment page, Workspace wizard 22, 41
Recent Workspaces command (File) 74 Set Program to Run page, Workspace wizard 21, 38
Redo command (Edit) 74 Shortcut keys
Registering the RM/COBOL compiler 129 on Build menu 76
Regular expressions 63, 64 on Edit menu 74
Remove Item command (File) 72 on Edit menu (Source Code/Edit window) 123
Replace command (Edit) 65, 75 on File menu 69
Replace dialog box 65 on Run | Breakpoint menu 79
Restore button 60 on Run menu 77
Restore command 60 on View menu 75
Results | Find Next command (Build) 77 on Window menu 79
Results | Find Previous command (Build) 77 Source code 49, See also Source Code Editor; Source
Resume command (Run) 78 Code/Edit window
RM/COBOL compilation results on Build Results tab 56
character sets 8 compiling 125
rmsetncs utility 8 editing 24, 97
RMPATH environment variable 19, 128 locating 97
rmsetncs utility 8 viewing 24, 103
Run | Breakpoint menu 79 Source Code Editor 97, See also Source code; Source
Run menu 77 Code/Edit window
Running Source Code/Edit window See also Source code;
animate the program 28, 78 Source Code Editor
control flow of execution 28 basic editing techniques 116
inspect and modify data 31, 66 correcting and editing text 122
modify and view watchpoints 30, 53, 89 cutting, copying, and pasting 121, 123, 124
program 25 deleting text 121
Run | Breakpoint menu 79 extending selections 120
Run menu 77 inserting new text 121
set breakpoints 29, 52, 88 insertion point 116
stop program 32 moving around in a file 116
RUNPATH environment variable 19, 23, 38, 42, 82, overwriting selected text 121
86 overwriting text 121
types of
dockable 46
document 46, 59
floating 46, 62
Workspace wizard 11, 20, 35
Introduction page 36
Set Additional Options page 40
Set Environment page 41
Set Program to Run page 38