CCOB - COBOL12 Compiler

CCOB.COM is a one-pass COBOL compiler which generates data and machine code in a .RUN file. This file is not compatible with a .COM or .EXE file; it requires RUN.COM to load and run it.

Memory requirements
CCOB requires a minimum of 167k bytes, but will use up to 197k bytes if it is available.

Source line format
The compiler will accept source lines of up to 256 characters without an identity field, although ECOB, the editor, has a maximum of 64 characters.

Invoking CCOB
It will be more usual to call for a compilation from within ECOB, the COBOL source line editor, but it may also be called directly as follows.

CCOB progname /d

The compiler displays the following information on the screen at the end of a successful compilation:

SH COBOL COMPILER Version 6.01 - Development
Compilation
Data segment: 11452 bytes
Code segment: 16820 bytes
Reference store utilisation: 11%

The compiled program may contain up to 65536 bytes each of data and code, including 256 bytes in each case, required by the system. CALLed programs also have the same size limits; they are not included in the size of the calling program.

Reference store utilisation
This shows the percentage of the compiler's user reference store used by this compilation. The compiler can accommodate about 2000 user references in the source program, which should be adequate in almost every case. Very long user references will decrease the number of references which may be accommodated.

If the compiler encounters errors in the source program, the following line is displayed:

Error count: 7 - No object program

The following files are required, used, or created by CCOB.

Progname.COB
The program source file to be compiled. It may reside in any directory, and is not affected by the compilation.

Progname.RUN
The program object file created by CCOB.COM if no errors are encountered. It is written to the current directory.

ERRORS.COB
The errors file generated by CCOB.COM if errors are found during the compilation. It is always written to the \COBOL directory.

ERRDESCR.DAT
A file of error descriptions in the \COBOL directory which is used by CCOB.COM to insert the description of each error into ERRORS.COB. If this file is not present, the errors will have blank descriptions.

OBJECT.RUN
A temporary object file used by CCOB.COM during the compilation, and deleted at the end of the run. This file will therefore only be present if the compilation was abnormally terminated; it may always be deleted without loss of any useful information.

If no errors are encountered, Progname.RUN is created to replace any existing file of the same name, OBJECT.RUN is deleted, and ERRORS.COB, if present, is unaffected.
If any errors are encountered, ERRORS.COB is created to replace any existing file of the same name, OBJECT.RUN is deleted, and Progname.RUN, if present, is unaffected.
Progname.RUN is written to the default directory, regardless of the directory in which the source file resides. The files ERRORS.COB and ERRDESCR.DAT are always in the \COBOL directory.

Features not implemented
The following COBOL features are not implemented in this compiler.

SWITCH
ALPHABET name
CODE-SET
RESERVE n AREAS
BLOCK CONTAINS
I-O-CONTROL
SD sort-file; SORT, MERGE, RELEASE, RETURN
REPORT SECTION
SIGN LEADING, TRAILING
SYNCHRONIZED
Qualified data names: (data-item OF record-name)
DECLARATIVES (but see USE statement)
ACCEPT dataname
ALTER
COMPUTE
INITIALIZE
STRING, UNSTRING

Non-standard additional features
The following features, not part of standard COBOL, are implemented in this compiler.

DIRECT file organization
LABEL RECORD dataname for sequential header records
NULL KEY for alternate indexed file keys
USAGE DATE, supporting date arithmetic
SCREEN SECTION for full screen editing, menus, and MOUSE use:
ACCEPT SCREEN, DISPLAY SCREEN
ACCEPT options: FROM PARAMETERS to access DOS call parameters
FROM [NEXT] FILE-ID to access file names
DELETE FILE to delete a file from disk
DISPLAY options: BELL, ATTRIBUTE, AT llcc
DISPLAY FORMAT to display a screen format from an ascii specification
display string in the Data Division.
EXIT PERFORM to discontinue inline Performs
PERFORM UNTIL EXIT for unconditional inline performs
READ - PRIOR RECORD to read previous record
SET DIRECTORY TO dataname to set current disk directory
SET condition-name TO FALSE
START, CANCEL, END TRANSACTION for BTRIEVE transaction processing.
WRITE - NO ADVANCING to support printer control codes
USE to trap file errors in the program

Error Comments
The error comments in ERRORS.COB may not always point to the exact word which is in error; it may point to the word following the error, and this may be in the next source line. Errors in the Procedure Division may occasionally not define the actual nature of the error because of the complexity of the program structure. However, there will be an error in the program at or about that point. One exception is where a structured statement (an inline Perform for instance) contains an error; this may cause spurious error comments further on within the scope of that statement.