|Debugging Assembler||Running with Multi-tasking|
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.
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.
If you have closed Mainframe Express, open it as before. If any project window or other windows are open, close them.
In this session you:
To create the project:
You now get a page asking which of the installed options this project uses.
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.
Leaving this unchanged means you will use the resource definition file supplied with Mainframe Express.
To add your files (the COBOL source file and BMS mapset file) to the project:
The files are added to the project.
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.
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.
The right-hand pane now lists all the PCT entries in the groups that are in the startup list.
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:
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.
The Add New Group dialog box appears.
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.
Now continue to add the new PCT entry:
|Transaction ID||ACCT (Type in upper case - this field is case sensitive)|
|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.
To add an FCT entry for the file used in the tutorial demo:
This displays a list of FCT entries in the right-hand pane.
The FCT Properties dialog box appears, with the new group MYDEMO already in the Group field.
|Description||Getting Started Demo file base|
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).
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:
To build the project:
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".
To run the application:
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.
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.)
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:
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.
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.
To debug the application:
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.
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.)
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.
The transaction completes without debugging, and exits. As before, the Application Output window shows a blank screen with a cursor.
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.
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.
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
You see a full list of the maps in this mapset.
This displays the map ACCTDTL in the right-hand pane.
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.
|Debugging Assembler||Running with Multi-tasking|