Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Rules for using the fixed form reference format

  • Sequence number area (columns 1-6)

    This field may be used to label lines of a COBOL program.

    The content of the sequence number area is defined by the user and may consist of any character in the computer’s character set.

  • Indicator area (column 7)

    This field is used to designate continuation, comment, and debugging lines.

    A hyphen (-) in this field signifies that this is a continuation line, i.e. the previous line is being continued (see "Continuation of lines" further below). The absence of a hyphen in the indicator field is taken to indicate that the last character in area B (see below) of the previous line is followed by one space character.

    An asterisk (*) supplied in this field indicates a comment line (see "Comment line" further below).

    A slash (/) in this field indicates a special kind of comment line, which causes a form feed to be carried out in the program listing before this line is printed.

    A letter D in this field designates a debugging line (see section "Debugging").

  • Program-text area (columns 8-72)

    This area is reserved for the beginning of the headers of the four COBOL program divisions, of the section headers and paragraph headings, for level indicators, and for certain level numbers. It is used to hold all clauses and statements.

  • Identification area (columns 73-80)

    This area may be used to assign names to lines of a COBOL program. It may contain any characters from the computer’s character set or may be blank. Its contents are not evaluated by the compiler.

  • Continuation of lines

    A sentence or entry requiring more than one line may be continued on subsequent lines in the program-text area. The first line is called a continued line, the following lines are called continuation lines. If a sentence or entry spans more than two lines then all lines, except the first and last, are both continued and continuation lines.

    A word, PICTURE character-string, or literal may be continued in the next line. If this occurs, the following apply:

    • Continuation of non-numeric literals

      If a non-numeric literal is continued on the next line, a hyphen should be entered in the indicator area (column 7) of the continuation line.
      The continuation of the literal may begin anywhere in the program text area and must be introduced by the same quotation mark as that used in the opening literal delimiter.
      All blanks located at the end of the continued line or following the delimiter of the continuation line or ahead of the delimiter which closes the literal are regarded as part of the literal.

    • Continuation of words and numeric literals

      If a word or a numeric literal is continued on the next line, a hyphen must be entered in the indicator area (column 7) of the continuation line in order to show that the first non-blank character in the program-text area of the continuation line is the immediate successor of the last non-blank character of the continued line, i.e. without any intervening space.

  • Blank lines

    A blank line is a line that contains only spaces in columns 7 through 72 or no characters at all. A blank line may appear anywhere within a compilation unit.

  • Comment lines

    Explanatory comments may be included anywhere in the COBOL source unit in the form of comment lines by setting an asterisk or a slash in the indicator area (column 7). Any combination of characters from the character set of the data processing system may be used in areas A or B of these lines. The contents of the comment lines will be produced on the program listing (at the top of a new page if a slash has been entered in the indicator area) and have no effect on the program.

  • Debugging lines

    Debugging lines are indicated by a "D" in the indicator area (column 7) (see section "Debugging").

  • Pseudo-text

    The pseudo-text, which consists of character strings and delimiters, lies in the program-text area. If the indicator area of a line following the opening pseudo-text delimiter contains a hyphen, it is possible to continue at any position of the program text line. Text words are continued in accordance with the normal rules for the continuation of lines.

  • Inline comments

    The asterisk and the greater-than sign (*>) in the program-text area precede a comment that extends to the end of the current line. A comment like this can stand alone in a line, but it can also be preceded by source text. In the latter case, the string '*>' must be preceded by a separator.

    In source code manipulation, comments like this are handled in the same way as spaces.

    Lines with an inline comment cannot be continued.