ECOB - COBOL12 Editor

Overview
ECOB provides a complete editing and development environment for COBOL programs compiled with CCOB. Successive programs may be edited, compiled, linked and run entirely from within ECOB.

A function key provides the ability to step through any compiler errors which are shown on a separate screen, thus expediting error correction.

As well as the main file which is being processed, there is also provision for a 'view' file to be stored separately alongside the main file. The view file may be inspected and compared with the main file, and groups of lines may be transferred between the main and view files.

Two separate bookmarks are available, to mark selected lines in the main or the view file, to be returned to later. It is also possible to switch between two specific lines with one bookmark, by using the bookmark as a link.

A context sensitive help service, as well as a general help service, functions as a ready reference to COBOL statement formats.

Block operations are provided to print, copy, delete and move blocks of lines in both files.

The editor uses upper case characters on all COBOL source lines, regardless of the setting of the shift key. The shift key is obeyed only for comment lines and literals.

Columns 1 to 6, containing the source line sequence number, are not displayed on the screen. The first column is therefore column 7, the column which contains an asterisk for comment lines, or the letter "D" for debug lines. The cursor never moves to this column however; its content is controlled by function keys The maximum line length is 64 characters, 58 characters on the screen.

A standard tab column is provided in column 31, normally used for the alignment of PIC in the Data Division. This tab column may be altered by the user at any time as required.

There are two restrictions in ECOB.

  1. The maximum number of lines, including both main and view files, is 4000. This is not expected to be a concern when COPY files are used in the COBOL environment.
  2. The maximum line length is 58 characters exclusive of the sequence number, or 64 characters overall. This is only 8 characters short of the 72 characters normally available.
Note.
In this documentation, the symbols ^ and ~ represent the Ctrl and Alt keys respectively. Thus for example, ^N represents Ctrl-N and ~F represents Alt-F.

RUNNING ECOB
There are two conditions required for the running of the editor:

  1. VIDPOP must be installed to support the screen display and the help service. Do this by invoking VIDPOP.
  2. ECOB.SWL contains the help display screens and must be available in the \COBOL12 directory.
Invoke ECOB.COM to edit a program as follows:
ECOB [progname]
Progname is the name of a .COB COBOL source program or module.

SUMMARY OF FEATURES AND EDITING KEYS

OPERATIONS
~F Invoke the Functions menu.
~V Toggle between the MAIN and the VIEW files.
F1Insert an asterisk in the first column of this line.
F2Insert the letter D in the first column of this line.
~S Search for a specific text string.
~C Change a specific text string to another string.
F3Find the next occurrence of the search argument. If changing, do not change the current occurrence.
F4Find the next compiler error.
~M Set a MARK at this line for F5, ~D, or ~P to follow.
~P Print from the MARK to the current line.
~D Delete from the MARK to the current line, and save the lines for copying later.
F5Save from the MARK to the current line for copying later.
F6Insert the currently saved lines before the current line.
^F7Set a bookmark at the current line.
F7Return to the line currently bookmarked.
~F7Set a bookmark at the current line and return to the line currently bookmarked.
F8As for F7, for a separate bookmark.
F9Move the cursor to the current tab column.
^F9Reset the standard tab column to the current cursor.
F10Toggle display of alternate screen; at the preceding ECOB start, Compile, or DOS exit.
~G Display the general help service menu.
~R Display a help menu giving access to reference lists.
~H Display the help screen for the current COBOL key word.
EnterInsert a new blank line following the current line.
^EnterTerminate the current line at the current cursor, and move the rest of the line to a new line inserted immediately following.
^N Insert a new blank line immediately before the current line.
^Y Delete the current line, and save for copying later (F6).

EDITING
Right arrowMove cursor right.
Left arrowMove cursor left.
HomeMove cursor between columns 2, 5, and the first character of the line.
EndMove cursor to first free column.
Up arrowMove cursor to previous line.
Down arrowMove cursor to next line.
^PgUpMove cursor to first line on screen.
^PgDnMove cursor to last line on screen.
PgUpDisplay previous screenful of lines.
PgDnDisplay next screenful of lines.
^HomeMove to start of file.
^EndMove to end of file.
DelDelete current character.
BkSpDelete previous character.
InsToggle Insert (underline cursor) and Replace (block cursor).

FUNCTIONS MENU

The functions menu may be called during editing by pressing ~F. Use the up and down keys to reach the function required, then press Enter. Alternatively, the first letter of the required function (upper or lower case) may be pressed.

Open file
Open a MAIN file to process. An existing MAIN file is replaced without saving it to disk. If the file is to be saved, it is necessary to invoke the save file function first.

Save file
Save the current MAIN file, and allow processing to continue. The option is provided to rename the file to be saved; the new name will be used by ECOB in all subsequent operations. The save operation, including compile, always renumbers the source lines in columns 1 to 6 in consecutive sequence, the first line being 1.

New file
Define a new MAIN file to process. If the current MAIN file is to be saved, it is necessary to invoke the save file function first. If the file SKELETON.COB is present in the COBOL directory, it will be loaded into the MAIN file area to serve as a program format, otherwise the lines in the MAIN file area will be blank.
SKELETON.COB is a standard COBOL source file which may be altered by the user if desired, to meet any particular requirements.

Edit current file
Display the current MAIN file for editing.

Compile to .Run [save]
Save the current MAIN file and invoke CCOB to compile to file.RUN, and return to ECOB. Described in more detail later.

Debug Compile [save]
This is the same action as the compile function above, except that any lines with the letter D in column 1 are also compiled. These lines are normally treated as comments unless this function is invoked, or unless the WITH DEBUGGING MODE option is included in the SOURCE-COMPUTER sentence.

Run program.Run
Exit temporarily from ECOB and run the current MAIN file.RUN. At the end of the program, ECOB is automatically returned to.
The same convention for naming COPY files for compilation is also used here to run a program. Refer to the detailed description of the compilation process, given later.

Link .Run to .Exe
Link the .RUN file corresponding to the current MAIN file, with the runtime routines to produce a freestanding .EXE file.

Perform program.Exe
Exit temporarily from ECOB and execute the current MAIN file.EXE. At the end of the program, ECOB is automatically returned to.

Invoke DOS
Exit temporarily and invoke DOS; all DOS operations are available. Type EXIT at the DOS prompt to return to ECOB. The current MAIN and VIEW files are retained.

View file load
Load a VIEW file, replacing any existing VIEW file. The current MAIN file is unaffected.

Zap view file
Clear the current VIEW file. Required only to release the lines used by the VIEW file for use in the MAIN file.

F10 - show screen
Display the alternate screen. Described in more detail later.

Quit Editor
Final exit from ECOB to DOS. If the current MAIN file is to be saved, the save file function must be invoked first.

Esc
Cancels the current function or function step and returns to the preceding step. The Esc key never exits from ECOB.

DESCRIPTION OF FEATURES

SCREEN FORMAT
The screen display is divided into two main sections. The main display on the left of the screen displays data lines from the MAIN or the VIEW file. The file name is displayed on the top line at the left, and at the right is the name of the other MAIN or VIEW file. Top and bottom lines in this area show the column numbers, and highlight the Tab column.
The right side of the screen displays the following details.

Line Counts
The number of lines presently allocated to the MAIN file, the VIEW file, the block of saved lines, and the number of lines still available to be used. If the number of saved lines is in reverse video, it indicates that the saved lines exist as part of a file and therefore do not count as separate lines.

Bookmarks
The first 14 non-blank characters of the line bookmarked by F7 and F8 if any, preceded by M or V in reverse video, indicating the MAIN or the VIEW file.

MARK
This appears only if a ~M MARK is current, followed by the first 14 non- blank characters of the marked line.

The remainder of this part of the screen display is a prompt list for the various keys and functions.

MAIN FILE
This is the primary source program file which is being processed by ECOB. It has a maximum size of 4000 lines of 58 characters each. The 'Load file' function reads a specified file into memory as the MAIN file, and the 'New file' function provides either a copy of SKELETON.COB or an empty MAIN file with a specified name.
There are only two functions which rewrite the MAIN file to disk: Save file, and Compile. If changes have been made and are to be kept, it is necessary to invoke the save file function before loading another file, starting a new file, or quitting ECOB. The file is always automatically rewritten to disk before a compilation Whenever the file is rewritten to disk, the source lines are renumbered from 1 in columns 1 to 6.

VIEW FILE
This is a separate file from the MAIN file, which is accommodated within the 4000 lines available to the MAIN file. If the View file function has not been used to load a VIEW file, the VIEW file area is still available as a null file. It may be used for the development of code lines outside of the MAIN file, or for the temporary storage of MAIN file lines. The ~V key toggles the screen display between the MAIN file and the VIEW file.
The VIEW file may not be saved, compiled, or run. To avoid confusion, these three functions cannot be invoked when the current file displayed on the screen is the VIEW file.

COMPILATION
The compile function is selected from the function menu, invoking CCOB to compile the current MAIN file to file.RUN.
A special convention is employed by ECOB to identify the host file for COPY files. If the name of the source file commences with a digit 0 through 9, it is assumed that it is a COPY file which is included in a host file, and the name of the host source file is the same as the current file, but without the leading digit. For example, 2PROGRAM.COB is assumed to be a COPY file included in PROGRAM.COB. Using this convention, ECOB is able to call for the compilation of the host program whenever the current edited file is a COPY file.
If the compiler encountered any errors during the compilation, these will have been written to \COBOL\ERRORS.COB. The ensuing action is then as follows.

  1. ERRORS.COB is read into the VIEW file area, replacing any file currently in that area.
  2. The screen display is set to the VIEW file of errors.
  3. The F4 key will move the cursor from the current VIEW file error line to the corresponding MAIN file line for that error, and aligns the cursor on the indicated column. Pressing F4 on the MAIN file display will return to the VIEW file error display.

ALTERNATE SCREENS
The contents of the screen which were displayed outside of ECOB are stored and are available at any time by pressing F10. Pressing F10 again will restore the original ECOB display.
The alternate screen will be the screen display when ECOB was invoked, or when ECOB was returned to from compiling, running, or from a DOS exit, whichever was the latest event.

CASE AND KEY CONTROL
This feature minimises the use of the shift key. All COBOL source lines use upper case characters regardless of the setting of the shift key. The shift key is obeyed if the current line is a comment line, or if the current data is a literal enclosed in quotes. However, upper case characters are used for hexadecimal literals, enclosed between pairs of quotes. This feature conforms to the use of upper case for COBOL source lines, and to the convention of using lower case for embedded comment lines.
A further feature is the switching of the rounded and square bracket keys. If the [ or ] key is pressed, the result is ( or ) respectively, and vice versa. It will take a short time to become accustomed to this, but its avoidance of the use of the shift key is a definite benefit.

TAB CONTROL
ECOB uses a standard Tab column, mainly for the alignment of PIC phrases in the Data Division. It is initially set to column 31, but it may be reset to any other column within an editing session by moving the cursor to the required column and pressing ^F9. The cursor is moved to the tab column by pressing the F9 key.

BLOCK OPERATIONS
Block operations provide the facility to print, copy, delete and move blocks of data lines. It is controlled by the following keys.

~M
This key marks the current line as the first of a block of lines. The first 14 characters, ignoring any leading blank columns, are displayed on the right of the screen as a reminder. The cursor should then be moved to the last line of the required block. Any other operation will cancel the mark.

F5
The marked block down to the current line is saved for subsequent copying, and the existing file is not altered. The mark is now cancelled.

~D
Delete the marked block entirely from the current file, but save the deleted block for subsequent copying. The mark is now cancelled.

~P
Print the marked block on the printer, but any block of saved lines from a previous operation is unaffected. The mark is now cancelled.

F6
Insert the current saved block of lines in the current file immediately preceding the current line. This action does not affect the saved lines themselves, which may therefore be inserted in the file as often as required.
Note that if F6 follows ~M without an intervening F5 or ~P, the mark will be cancelled and any existing block of lines will be inserted instead.

^Y
This is used in editing to delete the current line in the file. However, this line will also be saved as a one line block, thus replacing any previously saved block of lines. This line may then be inserted back into the file at the same or any other location with the F6 key.

BOOKMARKS
Two separate bookmarks are available, independently controlled by F7 and F8. The following description of F7 applies also to F8.

^F7
Set a bookmark at the current line.

F7
Return to the bookmarked line at any subsequent stage. This operation does not remove the bookmark.

~F7
Return to the bookmarked line as for F7, but in addition reset the bookmark to the current line where this key is pressed. Thus, ~F7 will toggle between two specific lines.

Bookmarks may be set in both the MAIN and the VIEW file, and will switch between the two files. Note also that the ~V key which toggles between the MAIN and the VIEW file also sets the cursor to the same current line existing at the previous ~V.

STRING SEARCH

~S
This key provides the user with the ability to specify a text string which is to be searched for. The position of the cursor in the specified string is critical; the characters at and to the right of the cursor are not part of the string. The search string is not case sensitive, and may contain spaces.
Pressing Enter will locate the first line from the current location in the file which contains that string. The cursor is moved to the string, which is highlighted in reverse video.

F3
The use of this key finds the next occurrence of the current search string. At the end of the file the search cycles back to the start of the file and the search continues. If the string is not found in the file, a message is displayed to that effect. The search string is preserved across both MAIN and VIEW files, and across the loading of further files. However, the string replace operation will destroy the search string.

STRING REPLACE

~C
This key initiates a replacement operation which proceeds until no further strings are found to replace, or until the Esc key is pressed.
The user is prompted to enter a text string which is to be searched for, exactly as with ~S for a string search. The user is then prompted to enter a text string which is to replace the specified search string.
The replacement text may be longer or shorter than the search string. It may also have no length, in which case the search string will be deleted. The replacement must be entered in upper and lower case text as required.
Pressing Enter will find the first occurrence of the search string from the start of the file, unlike ~S which starts from the current file location. A window at the bottom of the screen reminds the user of the three options available during the replacement operation:

 Enter   Replace the current string and find the next occurrence.
 F3      Do not replace the string, but find the next occurrence.
 Esc     Cancel the replacement operation.

If Enter or F3 does not find another occurrence of the search string, a message is displayed to that effect and the replacement operation is cancelled. Not other operation is permitted until this occurs, or the Esc key is pressed.

HELP SERVICE

~G
This displays the general help service menus, from which a topic may be selected and the corresponding help screen displayed.

~H
This provides context sensitive help with the current word, or by searching back in the same line from the current word until a key word is found, and corresponding help screen is displayed. If no key word is found, it defaults to the general help service menu.

~R
This key provides access to a menu of Reference ehlp screens, from which a selection may be made.

ERRORS

In general, error messages are displayed only when the error is concerned with the operation of ECOB itself, such as insufficient space to load a program. In the case of editing or other errors caused by user operations, a beep will attract the user's attention, and the error condition will usually be obvious from the context.