PreviousAssembler and CICS Assembler, CICS, IMS, DB2 (Host Compatibility Option)Next"

Chapter 34: Assembler, CICS, IMS, DB2 (SQL 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 SQL Option. See the chapter Assembler, CICS, IMS, DB2 (Host Compatibility Option) for a similar session using Host Compatibility 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 SQL Options to do this session.

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


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

34.2 Preparation

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

34.3 Sample Session

In this session you:

34.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 cdlidemo as the name of the project and change the name of the Project Folder to d:\mfuser\projects\gsdemo\cdlidemo, 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 SQL Option (rather than Host Compatibility Option), you now get a page asking for details of the SQL server the project uses.

  9. Ensure that all three check boxes contain check marks, and click Next.

  10. Click Finish.

    Mainframe Express checks that an SQL server is running on your computer. When it finds that none is, it displays a dialog box asking if you want to start one, and if it should check in future.

    You need the server running so you can use the SQL Wizard and run the application. You could start it later from the Tools menu, but it's convenient to start it here.

  11. Leave the check boxes unchanged, that is, with two checked, and click OK.

    The SQL server starts, with its window minimized. You can click it on the Windows taskbar if you want to see it, but as you don't need to watch it you can leave it minimized.

34.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\cdlidemo\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.

34.3.3 Adding a Table and Data

The DB2 database used in this session is installed with Mainframe Express. You run the SQL Wizard with the supplied DDL file to add a table and data:

  1. Ensure that Project is selected in the left-hand pane, then click empsala.sql in the right-hand pane.

  2. Click SQL For DB2 on the Tools menu, then click Execute SQL Empsala.sql.

    A message appears saying "Connecting to database". The SQL Wizard starts and runs minimized (you'll see it on the Windows taskbar). Guided by the .sql file, it creates a new database, adds a table and inserts table data, and then exits.

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

34.3.5 Building the Project

To build the project:

  1. Click Build on the Build menu.

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

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

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

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

34.4 Before Continuing

Hide the Application Output window.

Shut down the SQL server - click in its entry on the Windows taskbar to select it, then press Esc. It may take a few seconds to respond.

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.


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

PreviousAssembler and CICS Assembler, CICS, IMS, DB2 (Host Compatibility Option)Next"