This chapter describes how Mainframe Express emulates various facilities provided by MVS on the mainframe.
Mainframe Express emulates the following MVS facilities:
Mainframe Express emulates those MVS control blocks that are accessible to applications running in problem program state. The information stored in these control blocks is limited to that which has value and meaning to applications running in problem program state.
Control blocks are accessed in Mainframe Express in the same way as they are on a mainframe, by referencing the appropriate field in the Communication Vector Table (CVT). The address of the CVT is stored at absolute address 16 in memory, as it is on the mainframe.
MVS control blocks in Mainframe Express have the same structure as the mainframe versions, but only those fields most likely to be accessed by Assembler application programs are supported.
Many absolute memory addresses are used by the MVS operating system and the mainframe hardware itself. The Assembler and COBOL run-time systems under Mainframe Express intercept all accesses to memory locations 0 through 2047 and redirects them to a block of memory that is allocated from the PC operating system and initialized to emulate the bottom 2,048 bytes of memory on the mainframe. Therefore, no matter where in PC memory an Assembler or COBOL program is loaded, absolute addresses 0 through 2047 are guaranteed to exist and can be accessed and modified as on the mainframe.
This area of memory is known as the prefixed save area. You can map it using the control block IHAPSA.
The following sample project is supplied with Mainframe Express to illustrate how to access the MVS control blocks. A readme.txt file is supplied which describes how to create the project and run it.
Project |
Summary |
CTLBLKC | The CTLBLKC project contains a COBOL program which
calls an Assembler routine to extract information from the MVS control
blocks.
The readme file is in folder \mfuser\projects\demo\ctlblkc. The source files are in folder \mfuser\projects\demo\ctlblkc\source. |
The following table lists the MVS control blocks that are emulated by Mainframe Express and specifies any differences between the PC versions and the mainframe versions.
Mainframe Express supplies macros for Assembler to define the MVS control blocks. They are located in the folder mfe\source. The macros have the same name as the control blocks and have the .mac file extension. They describe the key problem program state fields. Only fields that are supported are named in the macros; the others are defined as "fillers".
Mainframe Express enables you to access MVS control blocks from a COBOL program. The following sample program shows how you can access the job, step, and program names for the currently running program.
IDENTIFICATION DIVISION. PROGRAM-ID. JOBINFO. DATA DIVISION. WORKING-STORAGE SECTION. 01 JOB-NAME PIC X(8). 01 PROGRAM-NAME PIC X(8). 01 STEP-NAME PIC X(8). LINKAGE SECTION. 01 PSA. 05 FILLER PIC X(540). 05 PSATOLD POINTER. 01 TCB. 05 FILLER PIC X(12). 05 TCBTIO POINTER. 05 FILLER PIC X(164). 05 TCBJSCBB POINTER. 01 TIOT. 05 TIOCNJOB PIC X(8). 05 TIOCSTPN PIC X(8). 01 JSCB. 05 FILLER PIC X(360). 05 JSCBPGMN PIC X(8). PROCEDURE DIVISION. * Address PSA SET ADDRESS OF PSA TO NULL * Address TCB SET ADDRESS OF TCB TO PSATOLD * Address TIOT SET ADDRESS OF TIOT TO TCBTIO MOVE TIOCNJOB TO JOB-NAME MOVE TIOCSTPN TO STEP-NAME * Address JSCB SET ADDRESS OF JSCB TO TCBJSCBB MOVE JSCBPGMN TO PROGRAM-NAME DISPLAY 'JOB NAME = ' JOB-NAME DISPLAY 'STEP NAME = ' STEP-NAME DISPLAY 'PROGRAM NAME = ' PROGRAM-NAME GOBACK .
Under MVS you can run a program that dynamically outputs a JCL job stream in the form of a SYSOUT data set, and you can specify that an external writer is to process the job stream. You can use the IBM-supplied external writer, INTRDR, or you can supply your own.
You can request an external writer in any of three ways:
Mainframe Express emulates the IBM-supplied external writer, INTRDR. It does not support user-supplied external writers.
The Mainframe Express emulation of INTRDR difers in the following ways from IBM's INTRDR:
Copyright © 2001 Micro Focus International Limited. All rights reserved.
This document and the proprietary marks and names
used herein are protected by international law.