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:- A Timer ECB to send messages to the console at each interval (determined by the configuration setting).
- MVS command handling:
P jobname- Stops the taskF jobname,ABEND- Invokes the ESTAEX recovery routineF jobname,HELP- Display command listF jobname,STOP- Stops the task
- Depending on the HLASM compile option (OPTABLE), it will use branch based or relative jump instructions.
- The source includes a ESTAE error handler to display the failing PSW as an example.
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.