Table of Contents Previous Next PDF


Debugging COBOL Programs

Debugging COBOL Programs
ART for Batch supports user COBOL program in runb/runbexci debugging for Micro Focus COBOL and COBOL-IT COBOL.
You can configure all the jobs and programs that you want to debug in the configuration file batchdebug.cfg. Only these jobs/programs configured in this file could be debugged. See Configuring for Debugging in Configuration File for more information.
To support COBOL debug, all COBOL programs must be compiled to output with debug information. In particualr, for Micro Focus COBOL, .idy file must exist.
Debugging with Micro Focus COBOL
Do the following steps to debug with Micro Focus COBOL.
1.
Create or modify batchdebug.cfg configuration file at ${JESROOT}. See Configuring for Debugging in Configuration File for more information.
2.
Start anim in a new terminal and the anim remains in waiting state.
3.
Submit your job. It makes Animator attach to the started COBOL program.
4.
Note:
At the end of debug session, you may need to detach Animator from the program that you just debug.
Debugging with COBOL-IT COBOL
Do the following steps to debug with COBOL-IT COBOL.
1.
Create or modify batchdebug.cfg configuration file at ${JESROOT}. See Configuring for Debugging in Configuration File for more information.
2.
3.
Use vncserver to start a VNC environment. In VNC xterm, start debug session with command deet -p your DEBUGID. It starts a Deet graphic UI and makes Deet attach to the COBOL program.
4.
Note:
At the end of debug session, you may need to detach Deet from the program that you just debug.
For more information about Deet graphic UI, see COBOL-IT COBOL documentation.
Configuring for Debugging in Configuration File
Whenever you launch runb or runbexci to start a COBOL application program, ART for Batch checks configuration file batchdebug.cfg at ${JESROOT} to determine whether to enable COBOL debug; therefore, to enable it, you should set this configuration file at the very beginning. Only the programs with the DEBUGID that you configure in batchdebug.cfg can be debugged.
The format of batchdebug.cfg is:
COBOL; DEBUGID;UserID;JobName;Program
Table 1 explains these fields.
 
X(40) or 1 ~ 999999999
For Micro Focus COBOL application programs, DEBUGID is a string that is required for enabling animation in COBOL. It is a character string of up to 40 characters. The string can have alphanumeric characters and underscore.
For COBOL-IT COBOL application programs, DEBUGID is a number ranging from 1 to 999999999.
Here are some examples.
Listing 1 and Listing 2 are examples for debugging all programs in job JOBA submitted by user A.
Listing 3 and Listing 4 are examples for debugging program1 in all jobs.
Listing 1 Debugging All Programs in One Job (Micro Focus COBOL)
COBOL;debugid1;A;JOBA;*
 
Listing 2 Debugging All Programs in One Job (COBOL-IT COBOL)
COBOL;101; A; JOBA;*
 
Listing 3 Debugging One Program in All Jobs (Micro Focus COBOL)
COBOL;debugid2;*;*;program1
 
Listing 4 Debugging One Program in All Jobs (COBOL-IT COBOL)
COBOL;102;*;*;program1
 

Copyright © 1994, 2017, Oracle and/or its affiliates. All rights reserved.