blueshantung

Example MVS Started Task | z/OS Mainframe

This example runs as a MVS started task and demonstrates a Timer ECB, MVS command handling and error recovery (ESTAE). It can be assembled with or without relative addressing.

Download

History

1.0.0
(05/03/2021) - Initial release. Minor relative addressing implemented.
1.1.0
(01/04/2021) - Full relative addressing now implemented when OPTABLE(ZS6) is specified.

Screenshots / Output

Description

This example MVS started task demonstrates the following:
  1. A Timer ECB to send messages to the console at each interval (determined by the configuration setting).
  2. MVS command handling:

    P jobname
    - Stops the task
    F jobname,ABEND
    - Invokes the ESTAEX recovery routine
    F jobname,HELP
    - Display command list
    F jobname,STOP
    - Stops the task

  3. Depending on the HLASM compile option (OPTABLE), it will use branch based or relative jump instructions.
  4. The source includes a ESTAE error handler to display the failing PSW as an example.
When you run the task, it will search for member EXMSTC00 in the PARMLIB concatenation and will use internal defaults if this isn't found.

Configuration

This program uses a member named EXMSTC00 in the PARMLIB concatenation. The member has the following contents:

*
Comments can be specified by placing an asterisk in the first column
FROM=00:00
Start timer from 00:00 (format HH:MM)
INTERVAL=15
Fire every 15 minutes (format must be MM)

JCL Setup

//STEP1     EXEC PGM=EXSTC,PARM='MEMBER=EXSTC00'
//STEPLIB   DD DISP=SHR,DSN=YOUR.LOADLIB
					

Abend or Error Codes

U0001
Workarea storage allocation failure

Environment

This program was written in z/OS HLASM Assembler and will run under OS/390 and z/OS in 31bit or 64bit. The code is re-entrant.
This program was developed and tested under z/OS 2.2 and z/OS 2.4.

Additional Macros

The program uses the STRING macro from https://gsf-soft.com/Freeware/STRING.html - I highly recommend this.

Assemble & Link

The program is a single source member and the JCL has been set up to create an object file and link into a load module. The JCL runs under JES3 so you will probably need to tailor it for your environment.

The macro language uses the OPTABLE() parameter at assembly time to determine the type of addressing used. I have set up relative addressing with the ZS6 option so it could use the additional instructions in the IBM z Systems EC12 processor (this parameter can be easily changed in the Macro language statements within the source code). Using relative addressing and the new opcodes, the code was reduced by 16 bytes.

Any other parameter which can be specified (and assembles the code correctly), will use branch-based instructions.