Chapter 16: MVS Emulation

This chapter describes how MSS emulates various facilities provided under MVS, OS/390 and z/OS on the mainframe.

MVS Control Blocks

MSS 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 MSS 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.

Low-memory Address Emulation in Assembler and COBOL

On the mainframe the prefixed save area (PSA) is mapped at absolute location 0. Many application programs access its contents. We provide software that allows your COBOL programs to access it without as if they were running on the mainframe.

Control Blocks Supported

Table 16-1 lists the MVS control blocks that are emulated by MSS and specifies any differences between the non-mainframe versions and the mainframe versions.

Name Description Differences from mainframe
IHAACEE Accessor Control Element ACEEVRSN is set to 2
IHAASCB Address Space Control Block  
IHAASVT Address Space Vector Table  
IHAASXB Address Space Extension Block  
CVT Communication Vector Table CVTTOD is set to X'20', indicating that the Time Of Day clock is operational.

CVTMVSE - the X'80' bit in CVTDCB is always on, indicating that you are running under MVS/XA or later.

CVT4MPS - the X'04' bit in CVTDCB is on (indicating that you are running on System/360 Model 65 MP) only if the MVS control blocks are above the 16MB line (that is, all three-byte addresses are stored as four-byte addresses in the same location).

CVTDATE is set with the century number (that is, it uses "0cyyddds" format, where "c" is century number - 0 for 20th, 1 for 21st, etc.)

CVT CVT Prefix The CVT prefix is set to all binary zeros.
IHACDE Contents Directory Entry One "null" CDE is allocated. So it appears to be using a program for which the load module has not been loaded.
IDADDSA Dynamic Storage Area (FSA - First Save Area) This is an 88-byte save area pointed to by TCBFSA. It is used as the TCB First Save Area.
IEFJFCBN Job File Control Block  
IEZJSCB Job Step Control Block  
IHAPSA Prefixed Save Area The X'01' bit in byte 7 (the first byte being byte 0) is on only if the MVS control blocks are above the 16MB line (that is, all three-byte addresses are stored as four-byte addresses in the same location).
IEESMCA SMF Control Area SMCASID is set to 'MSTR'.
IDADTCA Task Communication Area

The PRV address is always zero.

The storage overflow routine does not provide overflow segments; it merely abends with the abend code S80A. You must ensure that the ISA setting is adequate for your application.

IDADTCA TCA Prefix  
IKJTCB Task Control Block The TCB protect key is set to key 8.
IEFTIOT1 Task I/O Table A maximum of 256 TIOT entries (representing the first 256 DDs in the job step) are supported.
Table 16-1: MVS Control Blocks Emulated by MSS

Accessing MVS Control Blocks from COBOL Programs

MSS 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
     .

MVS External Writer

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 the following ways:

MSS emulates the IBM-supplied external writer, INTRDR. It does not support user-supplied external writers.

The MSS emulation of INTRDR differs in the following ways from IBM's INTRDR:

DB2 Call Attach Facility

You use the DB2 Call Attach Facility (CAF) to access DB2 subsystems and the data they manage. You do this by calling DSNALI with the appropriate series of functions. The MSS emulation of this facility behaves exactly as on the mainframe, with the following exceptions:


Copyright © 2008 Micro Focus (IP) Ltd. All rights reserved.