Information
Space announcement This documentation space provides the same content as before, but the organization of the content has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Optimization considerations (Code Debug CICS COBOL)


COBOL programs that are optimized using compiler options or using the CA-OPTIMIZER® compiler can be symbolically debugged with Code Debug CICS. Depending on the optimizing algorithm employed, execution trace, code stepping, and resuming execution at another statement under Code Debug CICS can appear to be incorrect.

An OPT indicator is displayed near the upper right corner of the screen if a C, COBOL, or PL/I program has been compiled with some level of optimization or inlining, as shown in following figure. For COBOL 5.1 and above, OPT(n) is displayed, where n is the level of optimization. For optimized C programs, either OPT or OPT(n) is displayed, depending on the level of optimization.

OPT Indicator on Source Listing (2.L) Screen

 ---------------------------- SOURCE LISTING (2.L) ----------------OPT(1)--C123
COMMAND ===>                                                   SCROLL ===> CSR
MODULE: CWDEMCB2 CSECT: CWDEMCB2          COMPILED: 03 JUN 2015 - 10.37.09
  LV ----- COBOL DATANAME KEEPS ---- -- ATTRIBUTES -- ----+---10----+---20--->
  77 CURR-PAY                        9(5)V99 NUM-DIS  0000000
  02 WA-HOURS                        999 NUM-DIS      $$$
  02 WA-RATE                         9(3)V99 NUM-DIS  00950
  **END**

------   ----------------------------- ASRA (DATA EXCEPTION) at CWDEMCB2.359 ->
000356
000357    300-EMPLOYEE-PAY-RTN.

The optimization technique used by high level language compilers attempts to improve the run-time performance of application programs. The methods typically used involve the rearrangement of object code to the point where there may be little correspondence between the sequence of generated machine instructions and the sequence of the source statements generated by the programmer.

Whether debugging is performed through specialized debugging software such as Code Debug CICS, or through the conventional method of manually reading dumps and matching them to compile listings, the process is more complicated when optimization has been used. In circumstances where code has been relocated and/or re-sequenced by optimization, it may be much more difficult to debug logic path problems.

Using the TEST compile option in IBM enterprise COBOL V5/6 and higher

Two advances in the newest IBM COBOL Compiler, Enterprise COBOL V5/6, are:

  • implementation of modern code optimization
  • exploitation of new machine facilities in the newest IBM mainframe processors.

Optimization can improve the performance characteristics of a COBOL program and help reduce its four-hour rolling average (4HRA) usage.

Unfortunately, it’s a well-documented fact that optimization makes debugging more difficult. When using IBM Enterprise COBOL V5/6 and higher, the optimization process can drastically change the sequential stream of machine instructions generated for each COBOL statement. The result is that, during the optimization process, machine instructions generated for one statement are moved a few COBOL statements before or after the current statement. This optimization process causes seemingly abnormal COBOL statement “jumping” when stepping through COBOL optimized code. This “jumping” effect—although technically correct—is not desirable when using a debugger to step though a program.

TEST compile option

Code Debug and CSS have implemented a method of minimizing this “jumping” effect. To use this feature, IBM Enterprise COBOL V5.x and V6.1 users must specify the COBOL Compile Time option TEST as follows:

TEST(NOEJPD,NOSOURCE)

The TEST option is required to enable this feature, but BMC’s research has shown that both the EJPD and SOURCE sub-options are not needed and should be turned off by specifying NOEJPD and NOSOURCE as shown above. Sub-options EJPD and SOURCE can be enabled if necessary, but their use is not recommended because they incur additional CPU, memory, and/or disk space overhead beyond what TEST itself adds.

DWARF/NODWARF Compile Sub-Options

IBM Enterprise COBOL V6.2 introduced the DWARF/NODWARF sub-option of the COBOL Compile Time option TEST. Like EJPD and SOURCE, the DWARF sub-option is not desired or utilized. To minimize the “jumping” effect when stepping through optimized COBOL code, it should be disabled as follows:

TEST(NOEJPD,NOSOURCE,NODWARF)

Specifying all three of these TEST sub-options under COBOL V6 and higher will result in the most optimal CPU, memory, and disk space usage.

For more information on optimization and the use of TEST, see the Enterprise Common Components (ECC) document Compuware Source Support Best Practices.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI DevX Code Debug for CICS 17.02