|Debugging COBOL||Multiple Assembler Programs|
Use Assembler Option to include an application that contains Assembler programs in a Mainframe Express project. You can compile, edit, link and debug your Assembler programs.
You need to have read the chapter Start Here for the Tutorials and worked through the first session, Using Mainframe Express, before you do this session.
You need to have installed Assembler Option to do this session. We assume you are familiar with Assembler on a mainframe.
This session takes you through maintaining and running on your PC an application that includes an Assembler program.
The way you build an application that includes Assembler depends on whether it uses CICS, IMS, DB2, whether the Assembler is called from COBOL, and so on. This session uses an application where an Assembler program is called from COBOL. Subsequent chapters in this Part illustrate several different types of application.
The demo application used in this session is a simple application that you might have downloaded from a mainframe. In this session, you get it working on your PC. It consists of one COBOL program and one Assembler program, together with a CLIST file. The Assembler source program contains some simple source errors, which you find and fix in this session.
Creating a project for an Assembler application is just the same as for a non-Assembler application. Since this application does not use CICS, IMS or SQL, it is just like in the chapter Using Mainframe Express.
To save you creating the project used in this session, we supply the project acobdemo.mvp.
In this session, you fix the source errors in one of the source files. If you should want to run the session again, you can restore the source errors by copying mfasm03.mlc into folder \mfuser\projects\gsdemo\acobdemo\source from \mfuser\projects\gsdemo\acobdemo\source\original.
In this session you:
To build the project:
As you saw in the chapter Using Mainframe Express, the correct compiler is automatically called for each source file - in this case, for the COBOL and Assembler files. The Assembler module is linked.
The build is over when you see the message "Build finished with 2 errors, 0 warnings, and 0 notices". Our Assembler source file contains two source errors.
The default is to compile and link this as a single module. A later session demonstrates linking as multiple modules.
The method of handling source errors in an Assembler program is the same as in a COBOL program, as shown in the chapter Using Mainframe Express. All the same facilities, such as Compress and Expand, are available. We will here illustrate another facility for moving around the source file.
If some messages have disappeared off the top of the Output window, drag the slider up or make the Output window bigger. You will see two messages, both: "... Invalid label or symbol ...".
A source view window opens, showing the source file with a red cross at the left of each erroneous line, and the cursor by the word that caused the first error message.
The cursor moves to the second error.
This automatically saves your source file, and builds the project again. The build finishes with "Build finished with no errors".
To run the application without debugging:
The application runs. The Application Output window appears and displays the screen output from the application. This application's screen output simply shows its progress. The messages starting "*CBL*" are displayed by the COBOL program, and those starting "*ASM*" by the Assembler program.
This application may pause before finishing.
You can leave the Application Output window visible, as the next section uses it as well.
To debug the application:
Using Start Debugging rather than Run causes the COBOL module to be debugged.
You see the same things happening on your screen as when running the application, but in addition a source view window appears, showing the source of Mfcbl03.cbl. The first messages from the CLIST file appear in the Application Output window, then execution pauses at the first COBOL statement of the application.
CALL 'MFASM03' USING PASS-AREA.
The Assembler debugger appears in the Application Output window, with the source code of the Assembler program ready to debug. It is shown in Figure 14-1.
Figure 14-1: The Assembler Debugger
The functions are accessed by pressing keys, shown in the menu at the bottom of the window.
The line that is about to execute is just above the register values. It is a BALR instruction.
Z is the Assembler debugger's equivalent of the in the COBOL debugger. It makes execution continue with no further debugging of the Assembler programs in the application.
The application continues without debugging. As before, this application may pause before finishing.
Close the source view window and hide the Application Output window.
The Acobdemo project is not used in the next session, Multiple Assembler Programs, but is used in a later session, Debugging Assembler. If you're planning to go straight on to the latter session, you can keep the project open.
If you want to take a break before going on to the next session, you can close Mainframe Express.
Return to the Tutorials Map in the chapter Start Here for the Tutorials and choose which session to go on to next, depending on your interests.
Copyright © 1999 MERANT International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.
|Debugging COBOL||Multiple Assembler Programs|