PreviousDebugging COBOL Multiple Assembler ProgramsNext"

Chapter 14: Assembler Applications

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.


14.1 Overview

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.

14.2 Preparation

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.

  1. If you have closed Mainframe Express, open it as before. If any project window or other windows are open, close them.

  2. Click Open Project on the File menu and open \mfuser\projects\gsdemo\acobdemo\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.

14.3 Sample Session

In this session you:

14.3.1 Building the Project

To build the project:

  1. Click Build on the Build menu.

    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.

14.3.2 Editing the Source Errors and Rebuilding

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 ...".

  1. Double-click anywhere on the first error message.

    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.

  2. Change the word REG6 on this line to REG06.

  3. Click Next on the View menu, then click Syntax Error.

    The cursor moves to the second error.

  4. Change the word ERRO3 on this line to ERROR3.

  5. Click Build on the Build menu.

    This automatically saves your source file, and builds the project again. The build finishes with "Build finished with no errors".

  6. Close the source view window, to prevent your screen getting too cluttered.

14.3.3 Running the Application

To run the application without debugging:

  1. Click Mfcbl03.tso in the right-hand pane to select it, then click Run on the Debug menu.

  2. Ensure that the Enable Assembler debugging check box is not checked.

  3. Click the TSO tab. The name of the CLIST file to run has defaulted to the one you selected.

  4. Click OK.

    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.

  5. If it pauses, click in the Application Output window and press Enter.

    You can leave the Application Output window visible, as the next section uses it as well.

14.3.4 Debugging the Application

To debug the application:

  1. Ensure Mfcbl03.tso is still selected, then click Start Debugging on the Debug menu.

    Using Start Debugging rather than Run g           causes the COBOL module to be debugged.

  2. Check Enable Assembler debugging. This causes the Assembler module to be debugged.

  3. Click the TSO tab, then click OK.

    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.

  4. Click repeatedly until you reach the line:

    CALL 'MFASM03' USING PASS-AREA.

  5. Click once more.

    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.

  6. Click in the Application Output window, then press S several times to step through the Assembler code.

  7. Press Z to run to the end of the Assembler program without further debugging.

    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.

  8. Click .

    The application continues without debugging. As before, this application may pause before finishing.

  9. If it pauses, click in the Application Output window and press Enter.

14.4 Before Continuing

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.

PreviousDebugging COBOL Multiple Assembler ProgramsNext"