COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-102
OPTIMIZE
OPTIMIZE
OPTIMIZE specifies the extent to which the compiler attempts to optimize the code it
emits.
level
is 0, 1, or 2. Optimization level has only a small effect on compilation speed. The
effect of each level is:
Level
Effect
COBOL85 Compiler NMCOBOL Compiler
0 Code is not optimized. Provided in
case other optimization levels
cause errors. Supports symbolic
debugging; data is always in
memory.
Code is not optimized. Provided in
case other optimization levels cause
errors. Supports symbolic debugging;
data is always in memory.
1
(default)
Code is optimized within
statements, but not across
statement boundaries. Appropriate
for application programs still being
developed and tested. Supports
symbolic debugging; data is not
always in memory.
Code is optimized within statements
and across statement boundaries. The
resulting code is more efficient than
that produced by lower levels of
optimization. Supports symbolic
debugging; data is not always in
memory.
2 Code is optimized within
statements and across statement
boundaries, and the resulting code
is more efficient than code
produced by lower levels.
Uses level 1 instead.
Note. For TNS HP COBOL programs, code generated under OPTIMIZE 2 is more difficult
to debug than code generated under OPTIMIZE 0 or OPTIMIZE 1. For NMCOBOL
programs, code generated under OPTIMIZE 1 is more difficult to debug than code
generated under OPTIMIZE 0. Optimization under OPTIMIZE 2 obscures statement
boundaries. Before you attempt to use a symbolic debugger to debug a program, do
either:
•
For a TNS HP COBOL program, be certain that the program was compiled with
OPTIMIZE 1; for an NMCOBOL program, be certain that the program was compiled
with OPTIMIZE 0.
•
Use the output generated by the CODE, ICODE, or INNERLIST directive to be certain
of statement boundaries.
OPTIMIZE level
VST297.vsd