PreviousDebugging Assembler Running with Multi-taskingNext"

Chapter 17: CICS Applications

Use CICS Option to include a CICS application in a Mainframe Express project. You can also maintain CICS resource definitions. You can compile your CICS application, edit it, and debug it in a CICS environment on your PC.


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 CICS Option to do this session. We assume you are familiar with CICS on a mainframe.


17.1 Overview

This session takes you through maintaining and running a CICS application on your PC. It shows you how to view and manipulate resources required for CICS application development.

The demo application used in this session is a simple CICS application that you might have downloaded from a mainframe. In this session, you get it working on your PC. You create a transaction called ACCT, which simulates a retail credit account. This demonstrates simple VSAM file query, update, and delete functions.

17.2 Preparation

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

17.3 Sample Session

In this session you:

17.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 cicsdemo as the name of the project and change the name of the Project Folder to d:\mfuser\projects\gsdemo\cicsdemo, then click Next.

  3. Ensure that Using this wizard is selected 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 only the CICS check box has a check mark, and click Next.

    Because you have said this project uses CICS, you next get some pages that you didn't get when you first used the Project Wizard, in the chapter Using Mainframe Express.

  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.

    Leaving this unchanged means you will use the resource definition file supplied with Mainframe Express.

  8. From the pulldown list, select DFH$IVP for the System Initialization Table and click Next.

  9. Click Finish.

17.3.2 Adding Files to the Project

To add your files (the COBOL source file and BMS mapset file) 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\cicsdemo\source. Ensure the Files of Type field is set to Source Files.

  3. Select all the files in the folder, then click Add.

    The files are added to the project.

  4. Click Done.

17.3.3 Viewing a Resource Definition File

Mostly, the resources used by this project are defined in the resource definition file supplied with Mainframe Express. Let's look at these.

In the chapter Using Mainframe Express we saw how the tabs at the bottom of the project window give you different views on the project. For example, the Files View shows the types of the files in the project.

Because our present project is a CICS project, it has an extra view, the CICS View.

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

    The CICS view has, in the left-hand pane, a tree view which you can use to select whether the right-hand pane shows entries in the Program Control Table (PCT), the File Control Table (FCT) or the Processing Program Table (PPT). Initially neither is selected, so the right-hand pane is empty.

  2. Click Program Control Table (PCT) in the left-hand pane, and click Yes on the message asking if you want to change which groups are being viewed.

  3. In the Viewable Groups dialog box, click View All in Startup List, then click OK.

    The right-hand pane now lists all the PCT entries in the groups that are in the startup list.

17.3.4 Creating a Group

We need to add a PCT entry for the transaction used in this demo, and an FCT entry for the file it uses. To start with, you create a new group for them:

  1. Right-click in the right-hand pane and click Add new entry.

    The PCT Properties dialog box appears.

    The Group field contains the group name CICSDEMO, which is the default group created with the same name as the project. For this tutorial, we want to create a totally new group and not use the default group.

  2. Click the down arrow on the Group field and click <Add New Group>.

    The Add New Group dialog box appears.

  3. Enter MYDEMO in the Group name field and Getting Started Demo in the Description field.

  4. Ensure that both the In current startup list and Viewable check boxes are selected, then click OK.

    The new group MYDEMO now appears in the Group field of the PCT Properties dialog box. This group is in the startup list and takes precedence over all other groups in the list. Any table entries made in this group will be the ones used during startup.

17.3.5 Adding a PCT Entry

Now continue to add the new PCT entry:

  1. Enter the following (leave the remaining fields unchanged), and click OK.
    Transaction ID ACCT (Type in upper case - this field is case sensitive)
    Program ACCT00
    Description Getting Started Demo trancode

    An entry for transaction ACCT in group MYDEMO appears in the list in the right-hand pane.

    The new entry for transaction ACCT appears above the entry for ACCT that is in group DFH$ACCT, and has a value of 1 in the Precedence column. This shows that the group MYDEMO takes the highest precedence during startup and that this definition of ACCT will be used instead of the one in group DFH$ACCT.

17.3.6 Adding an FCT Entry

To add an FCT entry for the file used in the tutorial demo:

  1. Click File Control Table (FCT) in the tree view in the left-hand pane.

    This displays a list of FCT entries in the right-hand pane.

  2. Right-click in the right-hand pane and click Add new entry.

    The FCT Properties dialog box appears, with the new group MYDEMO already in the Group field.

  3. Enter the following (leave the remaining fields unchanged), and click OK.
    File ACCTFIL
    Description Getting Started Demo file base
    Type KSDS
    Min LRECL 63
    Max LRECL 383
    Key Position 1
    Key Length 5

    An entry for file ACCTFIL in group MYDEMO appears in the list in the right-hand pane.

    The new entry for file ACCTFIL appears above the entry for ACCTFIL that is in group DFH$ACCT, and has a value of 1 in the Precedence column. This shows that the group MYDEMO takes the highest precedence during startup and that this definition of ACCTFIL will be used instead of the one in group DFH$ACCT.

    The PCT definitions for the other transactions used in the demo and the FCT definition for the alternate index for the file will be taken from the group DFH$ACCT in the supplied resource definition file.


Note: You can also add Processing Program Table (PPT) entries by right-clicking on Processing Program Table (PPT) and clicking Add New Entry. You do not need to add PPT entries for the files in this tutorial (PPT entries are optional for COBOL programs in Mainframe Express). However, there are times when you need to add PPT entries (data tables and PL/I programs require PPT entries).


17.3.7 Modifying the Build Settings

The COBOL program used in this demo needs the directive OS/VS COBOL, so before building you must set this in the build settings for the project:

  1. Click Project in the left-hand pane of the project view, and click Build Settings for Project on the Project menu.

  2. Click the COBOL tab.

  3. In the COBOL Dialect field, click the down arrow and select OS/VS COBOL.

  4. Click OK.

17.3.8 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 BMS files.

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

17.3.9 Running the Application

To run the application:

  1. Click Run on the Debug menu.

    The Start Debugging dialog box appears. Because the CICS Option is installed, this dialog box includes a CICS tab. We want to tell Mainframe Express the name of the transaction to run.

  2. Click the CICS tab, and enter ACCT in the Initial Tran Id field.

    ACCT is the ID of the transaction and must be typed in upper case as this field is case sensitive. (An option to convert to upper case is accessible from Configure Default Terminal on the Start Debugging dialog box, but we will assume this option is not set.)

  3. Click OK.

    Mainframe Express starts a single-tasking CICS region in which to run the transaction. You see several things happen.

    In the Output window, a CICS log tab appears. The CICS Log view appears in front of the other views in the Output window, and you can see messages showing the region starting up.

    The Application Output window appears. This window emulates a 3270 terminal. Messages appear, showing the application starting up, and the application displays its first map there. (If the Application Output window is undocked, its title bar changes to "Single Tasking Region (cicsdemo)" as well.)

    You can also click the Debug menu. You will see that Stop Debugging is enabled, while Start Debugging and Run are not. This shows that an application is running. (To close the menu again without executing a function, click on some neutral space.)

    In the following, note:

  4. Press CICS Clear (Esc).

    This exits from the transaction, and the Application Output window shows a blank screen with a cursor. If you wanted to run another transaction, you would enter its transaction id here.

  5. Type EXIT, then press 3270 Enter (right-hand Ctrl).

    Messages in the CICS log and the Application Output window show the region shutting down.

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

17.3.10 Debugging the Application

To debug the application:

  1. Click Start Debugging on the Debug menu .

  2. Click the CICS tab, and ensure ACCT is still in the Initial Tran Id field.

  3. 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 Acct00, the main program invoked by the ACCT transaction. The application has not yet displayed its first map in the Application Output window, because execution is paused at the first COBOL statement of the application.

  4. Click a few times, until the first map is displayed.

  5. Press 3270 Clear (Escape).

    The highlight returns to the IDE, showing the next statement to be executed. A second source view window has opened, because execution has jumped into a different COBOL program, Acct01. (If you have the "recycle windows" option set - click Edit on the Options menu, then Recycle window on the Source View page - the source of the second program replaces the first in the existing window.)

  6. Click a few more times.

    This demonstrates that you single-step a CICS application in the same way as any other. All the same debugging features are available for a CICS application as for any other application. We will not debug this application further, but will simply complete the run.

  7. Click .

    The transaction completes without debugging, and exits. As before, the Application Output window shows a blank screen with a cursor.

  8. Type EXIT, then press 3270 Enter (right-hand Ctrl).

    As before, the transaction completes and the region shuts down.

    You've now finished getting this application running on your PC. But before we finish this session, we'll look briefly at how you can view and edit a BMS mapset.

17.3.11 Viewing a BMS Mapset

In the chapter Using Mainframe Express we saw how opening a file loads the correct editor for that type of file. For a BMS mapset, the editor is the BMS Painter. We will look at how to use this to view a mapset. A later session demonstrates the editing of mapsets in detail.

  1. In the Files View, ensure that in the left-hand pane either Project or Source or BMS is selected, then right-click acctset.bms in the right-hand pane and click Edit on the popup menu

    In certain places in Mainframe Express, double-clicking an item executes the first function on the popup menu. Here, you could have double-clicked acctset.bms instead of right-clicking and clicking Edit.

    A BMS Painter window opens displaying the first map of acctset.bms, as shown in Figure 17.1.



    Figure 17-1: The IDE with a BMS Painter Window

  2. In the left-hand pane, click the "+" by ACCTSET, to expand the tree view.

    You see a full list of the maps in this mapset.

  3. Click ACCTDTL in the left-hand pane.

    This displays the map ACCTDTL in the right-hand pane.

  4. Close the BMS Painter window.

17.4 Before Continuing

Close both source view windows and hide the Application Output window.

The Cicsdemo project is used in two subsequent sessions, Running with Multitasking and Editing a BMS Mapset. If you're planning to go onto those sessions, 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 Assembler Running with Multi-taskingNext"