Rational Developer for System z, Version 7.6

Debugging a non-Language Environment COBOL program

You can use most of the Debug Tool commands to debug non-Language Environment COBOL programs that have debug information available. Any exceptions are noted in Debug Tool Reference and Messages. Before debugging a non-Language Environment COBOL program, prepare your program as described in Preparing a non-Language Environment COBOL program.

As you read through the information in this document, remember that OS/VS COBOL programs are non-Language Environment programs, even though you might have used Language Environment libraries to link and run your program.

VS COBOL II programs are non-Language Environment programs when you compile them with the NOTEST compiler option and link them with a non-Language Environment library. VS COBOL II programs are Language Environment programs when you compile them with the TEST compiler option and link them with the Language Environment library.

Read the information regarding non-Language Environment programs for instructions on how to start Debug Tool and debug non-Language Environment COBOL programs, unless information specific to non-Language Environment COBOL is provided.

Loading a non-Language Environment COBOL program's debug information

Use the LOADDEBUGDATA (LDD) command to indicate to Debug Tool that a compile unit is a non-Language Environment COBOL compile unit and to load the debug information associated with that compile unit. The LDD command can be used only for compile units that are considered disassembly compile units. In the following example, mypgm is the compile unit name of an OS/VS COBOL program: LDD mypgm

Debug Tool locates the debug information in a data set with the following name: yourid.EQALANGX(mypgm). If Debug Tool finds this data set, you can begin to debug your non-Language Environment COBOL program. If Debug Tool does not find the data set, enter the SET SOURCE or SET DEFAULT LISTINGS command to indicate to Debug Tool where to find the debug information. In remote debug mode, the remote debugger prompts you for the data set information when you step into the program.

Normally, compile units without debug information are not listed when you enter the DESCRIBE CUS or LIST NAMES CUS commands. To include these compile units, enter the SET ASSEMBLER ON command. The next time you enter the DESCRIBE CUS or LIST NAMES CUS command, these compile units are listed.

Debug Tool session panel while debugging a non-Language Environment COBOL program

The Debug Tool session panel below shows the information displayed in the Source window while you debug a non-Language Environment COBOL program.

 1 NL COBOL LOCATION: COB03O initialization                                       
Command ===>                                                   Scroll ===> PAGE
MONITOR --+----1----+----2----+----3----+----4----+----5----+----6 LINE: 0 OF 0
******************************* TOP OF MONITOR ********************************
****************************** BOTTOM OF MONITOR ******************************
SOURCE: COB03O ---1----+----2----+----3----+----4----+----5----+ LINE: 1 OF 111
    2  1     3 ******************************************************         .
       2       *  PROGRAM NAME: COB03O                              *         .
       3       *                                                    *         .
       4       *  COMPILED WITH IBM OS/VS COBOL COMPILER            *         .
       5       ******************************************************         .
       7        IDENTIFICATION DIVISION.                                      .
       8        PROGRAM-ID. COB03O.                                           .
       9       ************************************************************** .
      10       *                                                              .
      11       * LICENSED MATERIALS - PROPERTY OF IBM                         .
      12       *                                                              .
      13       * 5655-P14: Debug Tool for z/OS
      14       * (C) Copyright IBM Corp. 2004 All Rights Reserved
      15       *                                                              .
      16       * US GOVERNMENT USERS RESTRICTED RIGHTS - USE, DUPLICATION OR  .
      17       * DISCLOSURE RESTRICTED BY GSA ADP SCHEDULE CONTRACT WITH IBM  .
      18       * CORP.                                                        .
      19       *                                                              .
      20       *                                                              .
      21       ************************************************************** .
      22        ENVIRONMENT DIVISION.                                         .
      23        DATA DIVISION.                                                .
LOG 0----+----1----+----2----+----3----+----4----+----5----+----6- LINE: 1 OF 7
********************************* TOP OF LOG **********************************
0001 IBM Debug Tool Version 9 Release 1 Mod 0                                  
0002 10/30/2008 4:11:41 PM                                                     
0003 5655-U27: Copyright IBM Corp. 1992, 2008                 
0004 *** Commands file commands follow ***                                     
0005  SET MSGID ON ;                                                           
0006  LDD ( COB03O, COB03AO ) ;                                                
0007 EQA1891I *** Commands file commands end ***                               
******************************** BOTTOM OF LOG ********************************
                                                                               
                                                                               
PF  1:?          2:STEP       3:QUIT       4:LIST       5:FIND       6:AT/CLEAR
PF  7:UP         8:DOWN       9:GO        10:ZOOM      11:ZOOM LOG  12:RETRIEVE

The information displayed in the Source window is similar to the listing generated by the COBOL compiler. The Source window displays the following information:

 1  NL COBOL
This indicates that the current source program is non-Language Environment COBOL.
 2  line number
The line number is a number assigned by the EQALANGX program by sequentially numbering the source lines. Use the numbers in this column to set breakpoints and identify statements.
 3  source statement
The original source statement.

Restrictions for debugging a non-Language Environment COBOL program

When you debug non-Language Environment COBOL programs the following general restrictions apply:

%PATHCODE values for non-Language Environment COBOL programs

This table shows the possible values for the Debug Tool variable %PATHCODE when the current programming language is non-Language Environment COBOL:

%PATHCODE Entry Type
1 A block has been entered
3 Control has reached a label coded in the program.

Restrictions for debugging non-Language Environment programs

If you specify the TEST run-time option with the NOPROMPT suboption when you start your program, and Debug Tool is subsequently started by CALL CEETEST or the raising of an Language Environment condition, then you can debug both Language Environment and non-Language Environment programs and detect both Language Environment and non-Language Environment events in the enclave that started Debug Tool and in subsequent enclaves. You cannot debug non-Language Environment programs or detect non-Language Environment events in higher-level enclaves. After control has returned from the enclave in which Debug Tool was started, you can no longer debug non-Language Environment programs or detect non-Language Environment events.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)