PreviousJoins Creating Segment Layouts for an IMS DatabaseNext"

Chapter 22: IMS Applications

Use IMS Option to include an IMS application in a Mainframe Express project. You can compile, edit and debug your IMS application in an IMS 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 IMS Option to do this session. We assume you are familiar with IMS on a mainframe.

22.1 Overview

This session takes you through maintaining and running an IMS application on your PC.

The demo application used in this session is a simple IMS application that you might have downloaded from a mainframe. In this session, you get it working on your PC. You create a transaction called MFDEMO, which captures and maintains data for a table.

22.2 Preparation

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

22.3 Sample Session

In this session you:

22.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 imsdemo as the name of the project and change the name of the Project Folder to x:\mfuser\projects\gsdemo\imsdemo, 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 IMS check box has a check mark, and click Next.

  6. Click Finish.

22.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\imsdemo\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.

22.3.3 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, DBD, MFS, and PSB files.

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

22.3.4 Viewing Resources

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 an IMS project, it has an extra view, the IMS View.

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

    The IMS view has, in the left-hand pane, a tree view which you can use to select what the right-hand pane shows. Initially no entry is selected, so the right-hand pane is empty.

  2. Click Transactions on the left-hand pane.

    The right-hand pane now lists all the transactions in the application. Initially, there are none.

22.3.5 Defining a Transaction

You have to define a transaction for any program you want to run. To define a transaction:

  1. Right-click on the right-hand pane and click Add New Entry on the popup menu.

    The Transaction Codes dialog box appears.

  2. Enter the following (leave the remaining fields unchanged), and click OK.
    Program Type MPP A program run when its transaction code is entered.
    Trancode Name MFDEMO The transaction ID you enter to run the program.
    PSB Name DEMO001T The PSB Name associated with the program DEMO001T.
    Program Name DEMO001T The name of the program you want to debug or run.
    Process Limit Count 99 Any value greater than zero is allowed.

    An entry for transaction MFDEMO appears in the list in the right-hand pane.

22.3.6 Zeroloading a Database

A database must be Zeroloaded before an application can issue calls against it. To do this you can either Zeroload or Load the database using the IMSDBU database utility. A Zeroload creates the physical files and initializes them, creating an empty database. A Load consists of two parts - first the database is Zeroloaded, and then data is Loaded into the database. This is useful if you want to include data in your database or if you want to reset your database after testing.

We will Zeroload a database:

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

    The IMSDBU Database Utility window appears. It lists the database functions available, and the keys to invoke them. Across the bottom of the window are listed the keys you use to control the utility.

  2. Press F2.

    This displays a list of the databases in the project. There are two - DEMO03DD and TEST01DD.

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

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

  4. Type Z and press Enter.

  5. Press Enter again to confirm you want to zeroload DEMO03DD.

    Messages appear, showing the Zeroload starting and successfully completing.

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

22.3.7 Running the Application

To run the program for which you defined the transaction MFDEMO:

  1. Click Run on the Debug menu.

  2. Select the IMS tab, and enter MFDEMO in the Command or transaction code field.

    Once you enter a trancode or command, it will be remembered so you can select it from the drop-down list in the future.

  3. Click OK.

    The Application Output window appears. The application displays its first screen there.

    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, the Application Output window must be selected, that is, in front of the others (also known as "having focus"), so that keystrokes are directed to it and not to some other window. It should be automatically selected when it appears, but if in doubt click in it with your mouse.

    We will use this transaction briefly, to add a table to the DEMO03DD database.

  4. Type A (for Add) as the Function Code and TESTDEPT as the Table-ID, and press Enter.

  5. On the screen now displayed, enter the data shown in the following table. The left-hand column gives the name of each field, as displayed on the screen, and the right-hand column shows what you should type. You can use Tab to move the cursor to the next field, and Shift+Tab to move to the previous field. After you have finished, the window should look as in Figure 22-1. Then press Enter.

    Field: Data you should enter:


    Figure 22-1: The "Add Table" Screen in Transaction MFDEMO

    The Add Table screen appears again ready for you to add another table. We will not add another.

  6. Tab to the RETURN field at the bottom of the screen, and type X. Then press Enter.

    The transaction's main screen appears again.

  7. Type E (for End) as the Function Code and press Enter.

    This exits from the transaction, and the Application Output window shows a screen with a cursor and a message saying MFDEMO has ended. If you wanted to run another transaction, you would enter its name here.

  8. Type /RCL and press Enter.

    This exits from IMS. The Application Output window is cleared.

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

22.3.8 Debugging the Application

To debug the program for which you defined the transaction code MFDEMO:

  1. Click Start Debugging on the Debug menu.

  2. Select the IMS tab, and ensure MFDEMO is still in the Command or transaction code 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 DEMO001T, the main program invoked by the MFDEMO transaction. The application has not yet displayed its first screen in the Application Output window, because execution is paused at the first COBOL statement of the application.

  4. Click a few times.

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

  5. Click .

    The transaction runs without debugging, and the first screen is displayed. We will not use this transaction further.

  6. Type E as the Function Code and press Enter.

    This exits from the transaction, and the Application Output window shows a screen with a cursor and a message saying MFDEMO has ended.

  7. Type /RCL and press Enter.

    This exits from IMS. The Application Output window is cleared.

    You can leave the Application Output and source view windows open during the next section.

22.3.9 Configuring IMS

There are several configuration options you can set, including several for trace options to help in debugging. We will set some trace options.

To configure IMS:

  1. Right-click IMS System in the left hand pane of the IMS View and click Properties.

    The IMS System Configuration dialog box appears. It displays the configuration functions available as tabs across the top with the General Options page in view.

  2. Click the DL/I Trace tab.

  3. Select the boxes DB PCBs, I/O PCBs, SSAs, PCB Area, I/O Area, Call counts and Call timing.

  4. Click OK to return to the IMS View.

When you run or debug a transaction with these options set, an additional view, the DLI Trace View, appears in the Output window, to display trace messages.

22.4 Before Continuing

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

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.

PreviousJoins Creating Segment Layouts for an IMS DatabaseNext"