Terminal Format

Terminal format is convenient for interactive programming. Lines may be longer or shorter than 80 characters. Tab characters are expanded to every eight spaces. The terminal format divides the source line into four fields as follows:

Field Description
Indicator Area (column 1) The contents of this area are identical to the contents of the ANSI format area of the same name, with two exceptions:
  • If the conditional debugging indicator "D" is used, it must be preceded by a backslash (\). This places the "D" in column 2.
  • If a normal COBOL line is desired, the indicator area is eliminated (a space is not used).
Area A Starts immediately after the indicator area (either column 1, 2, or 3). It extends for four characters. For a standard source line, Area A starts in column 1.
Area B Starts after Area A, in column 5 or later, and extends to the end of the line or the start of the Identification Area.
Identification Area Starts when "|" or "*>" is encountered, provided it is not part of a literal. The Identification Area extends to the end of the line. This can be used to introduce in-line comments.

ACUCOBOL-GT allows up to 320 characters per line. If a line goes over the limit, the compiler issues a warning and truncates the line to 320 characters. If truncation causes an error, the compiler reports the error.

The following sample COBOL text is in terminal format:

* The following paragraph is a sample of terminal 
* format. Notice how comments and Area A both start 
* in column 1

TEST-PARAGRAPH.
      MOVE SAMPLE-1-VALUE TO SAMPLE-1.
\D    DISPLAY "SAMPLE-1 = ", SAMPLE-1.
      PERFORM EDIT-SAMPLE.