Chapter 37: Assembler, CICS, IMS, DB2 (Host Compatibility Option)

In this session you take an application that includes CICS, IMS, and DB2 and contains Assembler programs and get it working on Mainframe Express.

SQL Option and Host Compatibility Option are alternative facilities for handling a DB2 application. In this session you use Host Compatibility Option. See the chapter Assembler, CICS, IMS, DB2 (SQL Option) for a similar session using SQL Option.


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 also need to have worked through the first session on each of the Options used.

You need to have installed the Assembler, CICS, IMS and Host Compatibility Options to do this session.

We assume you are familiar with CICS, IMS, DB2, and Assembler on a mainframe.

You must also have IBM's DB2 Universal Database system installed. If you have DB2 V6 or later, you also need to install the IBM DB2 Software Development Kit (SDK). From V7 the SDK is called the Application Development Client.


37.1 Overview

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 several COBOL programs, one Assembler program, a BMS file, a DB2 database, and an IMS database. You create some CICS transactions to run it. The application is a suite of transactions to maintain employee records.

37.2 Preparation

If you installed both SQL Option and Host Compatibility Option, ensure Host Compatibility Option is active, as described in the section Preparation in the chapter DB2 Applications (Host Compatibility Option).

  1. Issue a DB2START command if you have not already done so. In the DB2 Command Window, enter:

    db2start

  2. You can now close the DB2 Command Window.

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

37.3 Sample Session

In this session you:

37.3.1 Creating a Project

To create the project:

  1. Click New on the File menu, then select Project on the New dialog box and click OK.

  2. Enter acihdemo as the name of the project and change the name of the Project Folder to d:\mfuser\projects\gsdemo\acihdemo, then click Next.

  3. Accept the default, Using this wizard, and click Next.

  4. Leave the default folder for the catalog unchanged and click Next.

    You now get a page asking which of the installed options this project uses.

  5. Ensure that the CICS, IMS and SQL check boxes have check marks, and click Next.

    Because you have said this project uses CICS, you get the pages that relate to CICS.

  6. Leave the default CICS region name unchanged and click Next.

  7. Leave the default folder for the resource definition file unchanged and click Next.

  8. From the pulldown list, select MCOSIT for the System Initialization Table and click Next.

    Because you have said this project uses SQL, and you installed Host Compatibility Option (rather than SQL Option), you now get a page asking the name of the DB2 database.

  9. Enter ACIHSAMP and click Next.

  10. Click Finish.

37.3.2 Adding Files to the Project

To add your files to the project:

  1. Click Add Files on the Project menu.

  2. In the Add Files to Project dialog box, open the folder \mfuser\projects\gsdemo\acihdemo\source. Ensure the Files of Type field is set to Source Files.

  3. Click Add All, then click Yes on the confirmation message.

    The files are added to the project.

  4. Click Done.

37.3.3 Creating a DB2 Database

You need to create the DB2 database:

  1. Click HCO on the Tools menu, then click Create Database.

    The Create Database dialog box appears.

  2. Type ACIHSAMP in the Database field and Sample database in the Description field, then click g on the dialog box.

  3. When it finishes, click OK on the message saying "Request completed", and then close the Create Database dialog box using its g button.

37.3.4 Adding a Table and Data

You use the supplied DDL file to add the table and data.

  1. Click HCO on the Tools menu, then click DDL Processor.

    The DDL Processor Tool appears. It auto-connects to the database ACIHSAMP specified in the project.

  2. Click Select DDL on the File menu of the DDL Processor Tool

  3. In the Select DDL File dialog box, open the folder \mfuser\projects\gsdemo\acihdemo\source. Ensure the Files of Type field is set to sql Files (*.sql).

  4. Select empsala.sql and click Open.

    This sets the DDL File field to the name of this file.

  5. Click g on the DDL Processor Tool.

  6. When it finishes, click OK on the message saying "DDL processing completed", and then close the DDL Processor Tool using its g button.

37.3.5 Modifying the Build Settings

We want the BMS compiler to recognize certain features recognized by the SDF BMS compiler on the mainframe.

  1. Click Project in the left-hand pane, then click Build settings for project on the Project menu.

  2. Click the BMS tab, then click Enable SDF features to put a check mark there.

    SDF features are used in the BMS mapset used in this session.

  3. Click OK.

37.3.6 Building the Project

To build the project:

  1. Click Build on the Build menu.

    The build finishes with "Build finished with no errors".

37.3.7 Creating an IMS Database and Loading it

You run the IMS Database Utility with the supplied .dbu file to create an IMS database for use by this application:

  1. Click IMS on the Tools menu, then click Database Utility on the popup menu.

  2. Press F2.

    This displays a list of the IMS databases in the project. There is one - CICSDLID.

  3. Make sure the cursor is just to the left of CICSDLID, then type S (for Select) and press Enter.

    The list disappears. The Database field on the IMSDBU window is now set to CICSDLID.

  4. Type L and press Enter.

    A screen appears where you can specify details of the Load operation.

  5. Set Input DSN to SOURCE\CICSDLI.DBU, and File Layout to G, (turn off Insert mode to type in the File Layout field), then press Enter.

    Messages appear, showing the Load starting and successfully completing.

  6. Press Enter to return to the main screen, then press Escape to exit the Database Utility.

37.3.8 Adding PCT Entries

To define CICS transactions for the project's programs:

  1. Click the CICS tab at the bottom of the project view.

  2. Click Program Control Table (PCT) in the left-hand pane

  3. Use Add new entry (right-click in the right-hand pane and click Add new entry), to add the transactions shown in the following table. Remember the Transaction ID is case sensitive. You can use Apply rather than OK after each entry, to make the dialog box stay up for you to use for the next one.

    Transaction ID Program Description
    CDI1 CICSDLI1 Program to handle the menu
    CDI4 CICSDLI4 Program to handle listings
    CDI5 CICSDLI5 Program to handle updates
    CDI6 CICSDLI6 Program to handle displays.

37.3.9 Running the Application

To run the application:

  1. Click Run on the Debug menu of the IDE.

  2. Click the CICS tab, and enter CDI1 (upper case) in the Initial Tran Id field, then click OK.

    The Application Output window appears, emulating a 3270 terminal. Messages appear, showing the application starting up, then the application displays its first map.

    We will make a simple change to one employee record.

  3. Press F4, then F5, then change the first name from JELEN to HELEN and press 3270 Enter (right-hand Ctrl)

  4. Press F3 twice, to return to the main menu and then to end the application.

  5. Press Esc and then type EXIT and press 3270 Enter (right-hand Ctrl) to terminate CICS.

37.4 Before Continuing

Hide the Application Output window.

You can close DB2 if you wish.

Close the project. 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.


Comments on the books? Click Send Us Comments.


Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names used herein are protected by international law.