Compaq COBOL AAQ2G1FTK User Manual
Page 545
Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration
B.4 Compaq COBOL and Compaq COBOL for OpenVMS VAX Behavior Differences
On Windows NT systems
C:\>
cobol/OPTIMIZE=4/WARN=ALL T1.COB
T1.COB(7) : Info: code can never be executed at label P2
P2.
^
Compaq COBOL is an optimizing compiler. One use of optimization is to perform
analysis for uncalled routines and unreachable paragraphs. The compiler
performs the unreachable code analysis for all levels of optimization, including
/NOOPTIMIZE or the equivalent
-O0
flag. Compaq COBOL for OpenVMS VAX
does not have an /OPTIMIZE qualifier.
B.4.2 Program Listing Differences
Some differences appear in program listings depending upon whether they were
produced by the Compaq COBOL for OpenVMS VAX compiler, the Compaq
COBOL compiler on Windows NT, Tru64 UNIX system, or OpenVMS Alpha
systems.
B.4.2.1 Machine Code
With Compaq COBOL, /NOOBJECT and
-noobject
cause the compiler to
suppress code generation, so no machine code is produced either for the listing or
for the object module.
With Compaq COBOL for OpenVMS VAX, /NOOBJECT suppresses just the
creation of the .OBJ. Compaq COBOL for OpenVMS VAX still does all the work
to generate the object code so it can be placed in the listing.
If you want the machine code to be included in the program listing, do not use
/NOOBJECT or
-noobject
.
B.4.2.2 Module Names
With Compaq COBOL, the name of the first program is the module name
throughout the compilation. With Compaq COBOL for OpenVMS VAX, the
module name changes as the various programs are encountered.
B.4.2.3 COPY and REPLACE Statements
The Compaq COBOL compiler and the Compaq COBOL for OpenVMS VAX
compiler produce output in slightly different formats when listing annotations for
the COPY statement in COBOL programs.
The following two compiler listing files illustrate the difference in the position of
the listing annotations, represented by the letter ‘‘L,’’ in a COBOL program using
Compaq COBOL and Compaq COBOL for OpenVMS VAX.
Compaq COBOL Listing File for COPY Statement
1 IDENTIFICATION DIVISION.
2 PROGRAM-ID. DCOP1B.
3 *
4 *
This program tests the copy library file.
5 *
with a comment in the middle of it.
6 *
It should not produce any diagnostics.
7
COPY
8 *
this is the comment in the middle
9
LCOP1A.
L
10 ENVIRONMENT DIVISION.
Compaq COBOL for OpenVMS VAX and Compaq COBOL Compatibility and Migration B–11