Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Source listing for a compilation unit

Each line of a source listing is subdivided into the following areas:

(1)

Indicator field

Column 1 gives information about errors in the user-defined numbering of the input records (S flag) and about any violations of the maximum line length of 80 characters in fixed format resp. 248 characters in free format (T flag). Furthermore, it identifies records copied from a COPY library (C flag), declared by a REPLACING or REPLACE (R flag) or associated with the Sub-schema Section (D flag). Column 3 shows the nesting depth for expanded COPY elements.

A minus sign (-) in column 1 identifies lines that have been ignored because of
compiler directives.

(2)

Sequence number field

Contains a number (max. 5 digits) assigned by COBOL2000 to identify the input compiler unit record. This number uniquely identifies the source code lines. It appears in all the listings generated by COBOL2000 as a cross-reference number. It is also used for reference in any error messages. Its maximum value is 65535. If a compilation unit exceeds this number, consecutive numbering starts again from 0.

(3)

At the beginning of each new page of a source listing, a line containing column markers (V) is generated after the heading. These markers conform to the COBOL reference format and make it easier for the user to recognize any violations of the column format required by COBOL.

(4)

Area that can be used by programmers to mark source lines

(5)

Compilation unit area

Contains the record entered by the user. Note that only printable characters are shown.

The following exist only in a “compressed” list (see the parameter SOURCE=YES(CROSS-REFERENCE=YES) in the section "LISTING option").

(6)

If a line contains more than one definition, or if there are implicit definitions in a compilation unit, these are shown in the compressed listing in additional lines containing only the right-aligned name of this definition instead of the source text.

(7)

REL LOC

Contains the position of a data definition or of a chapter or paragraph name relative to the start of the module.

(8)

LENGTH

Contains the (decimal) length of the area in the module which has been assigned to a data definition.

(9)

REF/DEF
Contains the sequence numbers of the lines that refer to a definition, together with the type of the reference (see section "Locator map listing" for an explanation of this reference type). In the case of the referring line, it is the sequence number of the definition line. If there are more cross-references than fit into a line, continuation lines are formed (see the LINE-SIZE parameter in the section "LISTING option").

The compilation messages are "merged" in the sample listing (see the INSERT-ERROR-MSG parameter in the section "LISTING option").

A library listing is output as the second part of the source listing. The sources from which the COBOL program processed in this compilation run was created can be found in this library listing. A line is created for each COPY statement, containing the following information:

(10)

Sequence number of the program line containing the COPY statement

(11)

Link name from the COPY statement

(12)

Library type

(13)

Element (member) name

(14)

Date

(15)

Version number under which the library element is entered in the library. The date and version number are not always present.

(16)

File name under which the library is entered in the file system


Special features of the source listing for free format

Significant differences between fixed and free format which are visible for the user affect the listing.

In the listing the free format line is broken to form partial lines, each of which is up to 80 characters long. This partial line length is derived from the old line length (sequence area + indicator area + program text area + comment area). Free format means that program text is involved over the entire partial line length.

Lines which are not longer than 80 characters a listed as previously, making full use of the available space. A line which is 81 to 160 characters long is divided into a partial line with 80 characters and a smaller partial line containing 1 to 80 characters. The latter partial line is not assigned a preceding line number for identification purposes, but only a single “+” character.

By the same token, lines containing 161 to 240 characters are divided into three lines. Lines which are 241 characters long or more are divided into four partial lines. In this case the fourth partial line is at most 8 characters long as the maximum line length is limited to 248 characters.

In this form of the listing the partial lines are directly beneath each other.

If the compressed listing (see the section "LISTING option") is activated, the same listing extract looks as follows:

As the XREF outputs occasionally force the insertion of additional empty lines, it can only be seen from the “+” character at the beginning of the line whether such an inserted line has been generated owing to XREF entries or whether a genuine partial line is involved which by chance only contains blanks (see example line 00085).

The assignment of the XREF entries to the corresponding partial lines always relates to the first character of a file name.

The line break of a free format COBOL line does not always result in a listing which is easy to read. It thus makes sense to achieve a more straightforward listing through a suitable grouping of the program text elements, for example by aligning the program text elements to specified tabulator positions (20, 40 or 80 characters). In many cases it is advisable to restrict the line length to 80 characters.