If the enterprise server is not yet started, you need to start it as follows:
The demonstration application includes around 60 programs and just eight of them, the ones which are included in the project, are debuggable. The default debugger in Enterprise Developer is the CICS Debugger. You need to select the JCL debugger to debug the batch Bankdemo application:
To start the debugger:
Visual Studio enters debug mode and opens a few new windows.
The application is now waiting for an event that will trigger the debugging.
You can now look at some simple features inside the debugger. To submit the JCL job:
The debugger starts, and the IDE opens ZBNKEXT1.cbl for debugging, with the execution point set on the first line of Procedure Division.
The highlighted line of code is the one the IDE will execute next.
The PERFORM statement executes and takes you to the line starting with IF TIMER-START.
The application runs and executes the instructions till the line you selected.
There are a number of default windows which you can use while debugging the application such as:
This adds the item to the Watch window so you can see how it changes as you step through the code.
There are some additional windows you can use as well. To open them:
Note that the windows are stacked, with a tab running along the bottom of the window.
While debugging, you can preview the values of data items in the current context as follows:
This opens a pop-up with the value of the item in the current context:
Open the Breakpoints window - currently, there are no breakpoints set in the program. You can set a simple breakpoint as follows:
The execution of the code stops at the first breakpoint.
You can see that ZBNKEXT1.cbl finishes and the debugger starts to debug the second program defined in the JCL.
This program executes to completion and the job completes.
In native COBOL, you can set COBOL watchpoints on data items in the code, and watch the memory associated with that data item. You can add a COBOL watchpoint as follows:
This adds the item to the COBOL Watchpoints window.
You can use the COBOL Source Information (CSI) functionality and its Quick Browse dialog to obtain information about your program when you are debugging it.
See COBOL toolbar in the product help for more information.
The results are shown in the Micro Focus Code Analysis window:
Enterprise Developer provides a few COBOL reports which you can run against your COBOL programs to help you understand and optimize them. For example, to run a report to identify any code that cannot be reached or executed, you need to run an unreferenced data report:
The IDE shows the results in the Micro Focus Code Analysis window:
Although the job has completed, the debugger is still waiting for the next event. To stop debugging: