Chapter 25: Configuring JCL Timeouts

This chapter describes how you can configure timeouts for JCL jobs.

Overview

On a Z/OS system, both runaway and looping batch jobs can be controlled by the use of the TIME= parameter. This can operate on the JOB card. The TIME= parameter takes the form of: TIME=(x,y) where x is a time value in CPU minutes, and y is a time value in CPU seconds.

The Enterprise Server environment does not recognize the concept of CPU seconds. To allow for this, Enterprise Server includes a mechanism that enables you to configure a value in real seconds to equate to the CPU seconds that are coded in your JCL. Using this mechanism, you can configure a JCL job to abend long running jobs if they take longer than the boundaries you set.

A timeout can only be applied to a job when you have defined a class-specific timeout multiplier and/or a Default multiplier. If a multiplier has not been defined as the Default and a multiplier is not available for the specific CLASS of the job in question, then no timeout can be applied to the job.

Difference with the TIME= parameter

Abends - S322:

On a mainframe, a job abends with an S322 abend code when the TIME value has been exceeded on a per job or per step basis.

The method used to end a job is:

For all timeouts, the ESMAC Condition Code associated with the job is an S322. The job termination codes, as shown in the joblog, are either S222 in the event of a successful "soft kill" or nothing in the event of a successful "hard kill" In both cases a message similar to the one below is written to the console.log file:

CASKC6002I JOB10347 terminated due to exceeding TIME parameter 05:01:20

Maximum number of actual Seconds

The maximum number of "real" seconds that can be used for a timeout value (calculated) for a JOB/STEP is 65533, or approximately 18.2 hours. If the time as calculated exceeds 65533 seconds, then a JES000034E message, as shown below, is issued to the console and the maximum value of 65533 seconds is applied to the job.

JES000034E JOB10348 - TIME parameter exceeds 65533 after applying class multiplier (0100)

Rerun/Recovery method

On a mainframe, the third dataset disposition (abnormal termination) is always triggered and processed upon receipt of an S322 abend.

In the Enterprise Server environment however , the abnormal dataset disposition processing for an S322 abend is ONLY processed when a "soft kill" can be issued. The DBMS commit/rollback can be used, and will process as expected

How the timeout is calculated

The timeout calculation is made by first attempting to apply a job CLASS-specific multiplier. If this multiplier is not present, the process applies the default setting. If neither is present then no timeout is applied to the job. In the example jobstream below, the job has specified a maximum TIME of 20 seconds of CPU time.

If CLASS=C jobs run with a multiplier of 2, then the job will run for between 40 and 50 seconds before being cancelled automatically by the system. This run time refers to actual execution time only, and does not include the time that the job spends in the INPUT or INPUT HOLD queues.

The Overhead value is a machine-dependant figure that is typically between 6 and 10 real seconds. It can vary in either direction depending upon the machine's workload and CPU speed. Any minutes specified on the JOB card are converted to CPU seconds before calculating.

The timeout is is calculated as follows:

Real Seconds = (TIME * Multiplier) + Overhead

For example, in the code below, the timeout is set for around 40 seconds.

//DMFBR14 JOB 'DMFBR14',CLASS=C,MSGCLASS=A,TIME=(,20)
//**************************************************************
//* Timeout after running for about 40 seconds. (Class C Multipler of 2)
//**************************************************************
//* Copyright (C) 1985-2008 Micro Focus International Ltd.
//* All rights reserved.
//**************************************************************
//*
//* Run one step for about 1 minute
//*
//STEP1 EXEC PGM=INFINITE,PARM='00012'
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//JBSTATUS DD SYSOUT=*,DCB=(LRECL=80,RECFM=FB,DSORG=PS)
//*

How to...

Establishing "Default" and "By Class" timeout values

The sample jobstream below can be used to display and/or modify the settings used to calculate the number of actual seconds that can elapse before a job is cancelled automatically. In the code below:

//SETMULT JOB 'SETMULT',CLASS=A,MSGCLASS=X,NOTIFY=MFIDMF
//*
//* List out all the values contained in jesinfo.dat
//* 
//LIST01 EXEC PGM=MVSP0036,PARM='LIST'
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*,HOLD=Y
//SYSIN DD *
/*
//*
//* Set the values in jesinfo.dat for TIME= multipliers
//* as a default and on a class by class basis.
//* The multipliers are used in an attempt to equate CPU Seconds
//* to "real" seconds.
//*
//STEP10 EXEC PGM=MVSP0036,PARM='JESMULTIPLIER'
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*,HOLD=Y
//SYSIN DD *
DEFAULT(0010)
A(0009)
B(0004)
C(0002)
D(0100)
/*

Note the following:

How to

New Messages

This functionality generates the following messages:

CTF Tracing/CAS AUX Tracing

The following tracing functionality has been added:


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