Moving your mainframe applications to the PC enables you to take advantage of Mainframe Express' powerful editing and debugging environment. There are instances, however, when it is not possible to move part of an application from the mainframe, and in some of these cases you can use Mainframe Express' Mainframe Call Generator.
The following are all things that an application might do that, without the use of the Mainframe Call Generator, would prevent it from being used with Mainframe Express:
This chapter describes the Mainframe Call Generator, how it works, and how you use it your applications.
The Mainframe Call Generator works by creating a stub program for each mainframe-hosted program your application needs to call. When invoked, a stub program calls the corresponding program on the mainframe (using communications provided by Mainframe Access' SourceConnect). Figure 7-1 shows the events that happen when a stub program is invoked.
Figure 7-1: A Stub Program Calling a
Mainframe-hosted Program
Before you start using the Mainframe Call Generator, there are a few preparatory steps you need to perform:
The process for generating and using stubs to run programs on a mainframe is as follows:
Once you have specified the programs containing the subprograms you want to create stubs for, information about the subprograms is displayed in the Mainframe Call Generator dialog box. It is from the Mainframe Call Generator dialog box that you specify the subprograms to create stubs for. Figure 7-2 shows a typical Mainframe Call Generator dialog box.
Figure 7-2: The Mainframe Call Generator
Dialog Box
The following list shows the information presented by the Mainframe Call Generator dialog box:
Column |
Description |
---|---|
Name | The name of the called subprogram. If the called subprogram's name is specified by a data item, the name of the data item is shown. |
Target | The name of the subprogram to be called on the mainframe. This is usually the same as the program-name in the Name column, but can be changed by editing a subprogram's properties. |
Status | The status of the call to the subprogram. This can be
one of the following:
|
Module Type | Whether or not the COBOL subprogram is optimized. This
can be one of the following:
|
DB2 | Whether or not the called subprogram uses DB2. Edit the subprogram's properties to change this setting. |
Call Type | The type of call made that will be made when the
application is run. This can be one of:
|
Location | The location of the found subprogram. |
Once you have created the stubs for your subprograms, you can run the calling program in the usual way. When calls to the mainframe-hosted subprograms are encountered, those subprograms are invoked by the generated stubs, so the calling application runs in the same way regardless of whether its subprograms are hosted on the mainframe or a local PC.
When a stub executes, you might be prompted for additional information:
Most of the time, the Mainframe Call Generator's default behavior will be enough to enable you to run your mainframe-hosted subprograms. This section describes aspects of the Mainframe Call Generator's behavior that you can change when the default behavior is not right for your application.
If the subprogram you are calling uses DB2, you need to specify this in the subprogram's properties, in order for the Mainframe Call Generator to insert additional code in the generated stub. See the online help information on how to change the properties of a subprogram to specify that it calls DB2.
When using Mainframe Call Generator to run a mainframe-hosted subprogram that uses DB2, you are prompted to specify the subsystem and plan to connect to.
By default, the stub created by the Mainframe Call Generator calls a mainframe subprogram with the same name as the stub. However, if you want the stub to call a program with a name different to that of the stub, the Mainframe Call Generator lets you do this by specifying a different target name in a subprogram's properties. This would be useful if you wanted to call a mainframe program that had an alias on the mainframe environment. For example, to call a program called MQGET on the mainframe, where the program MQGET has an alias called CSQBGET on the mainframe batch environment, you could create a stub called MQGET that called subprogram CSQBGET on the mainframe. See the online help information on how to change the properties of a subprogram to specify it calls an alternative target name.
By default, when you create a stub for a subprogram, the Mainframe Call Generator creates a COBOL program, compiles it to .gnt code, then deletes the COBOL program (as it is only the .gnt code that is required for your program to access the subprogram on the mainframe).
If you need to keep the COBOL program that the Mainframe Call Generator produces, check Keep stub program source on the Mainframe Call Generator window before you generate the stubs. The programs generated with this option are created in the specified generation directory, with the extension .bb.
Copyright © 2002 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.