Compaq AAQ2G1FTK Marine Radio User Manual


 
Developing Compaq COBOL Programs
1.3 Developing Programs on OpenVMS Alpha
1.3.2.9 Using Compiler Listing Files
A compiler listing file provides information that can help you debug or
document your Compaq COBOL program. It consists of the following sections:
Program listing
The program listing section contains the source code plus line numbers
generated by the compiler. Any diagnostics will appear in this section.
Storage map
The storage map section is optional (produced by the /MAP qualifier); it
contains summary information on program sections, variables, and arrays.
Compilation summary
The compilation summary section lists the qualifiers used with the COBOL
command and the compilation statistics.
Machine code
The machine code section is optional; it displays compiler-generated object
code.
To generate a listing file, specify the /LIST qualifier when you compile
your Compaq COBOL program interactively as in the following example for
PROG_1.COB:
$ COBOL/LIST PROG_1.COB
If you compile your program as a batch job, the compiler creates a listing file by
default. You can specify the /NOLIST qualifier to suppress creation of the listing
file, if that suits your purposes. (In either case, however, the listing file is not
automatically printed.) By default, the name of the listing file is the name of your
source file followed by the file type .LIS. You can include a file specification with
the /LIST qualifier to override this default.
When used with the /LIST qualifier, the following COBOL command qualifiers
supply additional information in the compiler listing file:
/COPY_LIST—Includes source statements specified by the COPY command.
/CROSS_REFERENCE—Creates a cross-reference listing of user-defined
names and references.
/MACHINE_CODE—Includes a list of compiler-generated machine code.
/MAP—Produces maps, data names, procedure names, file names, and
external references.
For a description of each qualifier’s function, invoke the online HELP facility for
COBOL at the system prompt as follows:
$ HELP COBOL
Compiler Listing File for a Contained Program
A contained COBOL program listing file includes two additional program
elements that provide nesting level information about the main program and
the contained program. For additional information about contained programs, see
Chapter 12, Interprogram Communication.
1–38 Developing Compaq COBOL Programs