In BS2000 there are three different time limits which affect the user in timesharing mode: a user ID-specific, a task-specific and a program run-specific time limit.
A user ID-specific time limit is specified by systems support in the JOIN entry (user entry). When a task terminates, the BS2000 accounting system deducts the consumed CPU time from this specified time allowance.
When a task starts, the maximum CPU time (task time limit, TTL) can be specified.
Batch jobs:
The CPU time that can be specified is the minimum from the time quota of the user entry and the maximum value from the job class definition.Dialog jobs:
The maximum CPU time is defined by the maximum value from the job class definition, if the CPU time value in the user entry is greater than zero.
If no maximum CPU time is specified, the default value from the job class definition or, if applicable, the lower time allowance of the JOIN entry is taken over as the maximum CPU time of the task. Users for whom the no-time-limit (NTL) privilege is specified in their JOIN entry, and the user ID TSOS can start tasks without time limits (NTL tasks).
Since the time allowance in the JOIN entry is not updated until the task is completed, the maximum CPU time (and if applicable the actual time consumed) of several tasks of one user ID can together exceed the time allowance.
When a program is loaded or started, a maximum program runtime can be specified for it (program time limit, PTL).
Interactive and batch jobs behave differently with regard to the maximum CPU time of the task (TTL) and the maximum program runtime (PTL):
TTL or PTL reached in batch job
When the batch job has used up the maximum CPU time, no program is loaded and TTL < 300 seconds, the task is terminated with the following message on the console:
EXC0736 ABNORMAL TASK TERMINATION.
ERROR CODE '(CMD1011)': /HELP-MSG (CMD1011)
When the batch job has used up the maximum CPU time, a program is loaded and TTL >= 300 seconds, the following message is output to the console:
EXC0070 Batch job with TSN (&00) has reached time runout.
When the system parameter DIATTL=Q is set (see section "TTL or PTL reached in interactive job"), the batch job is terminated.
Otherwise the job is now stopped for 20 minutes if a program is loaded. If there is no program loaded, then the job’s TTL is increased by 5 minutes. During this time (5 CPU minutes or 20 minutes of time) the systems support then has a maximum of 20 minutes in which to increase the maximum CPU time of the batch job via the CHANGE-TASK-CPU-LIMIT command. This prevents important batch jobs from terminating prematurely because of a timeout.
If the maximum CPU time of the batch job is not increased within the wait time of 5 or 20 minutes, the batch job is terminated (finally). A distinction is made between the following two cases:
If the TTL or PTL was reached during a program run, message
EXC0072
is output or, if applicable, a STXIT routine is processed which is allowed to consume up to a further 30 CPU seconds. When the STXIT routine has been processed or at the latest after 30 CPU seconds, the program is terminated with messageEXC0073
.The task itself is then terminated (TTL) or the spin-off is triggered (PTL). If error processing is planned, further processing continues with the next SET-JOB-STEP or IF-BLOCK-ERROR command. Otherwise, processing terminates on the next EXIT-JOB or LOGOFF command (PTL).
EXC0072 TIME LIMIT FOR TASK/PROGRAM EXCEEDED. PROGRAM TERMINATED
EXC0073 MAXIMUM PROGRAM RUNTIME EXCEEDED. 'STXIT' ROUTINE OR
PROGRAM RUN USED UP 30 SECONDS.If the TTL was reached during the processing of BS2000 commands, the task is terminated with the following command:
EXC0736 ABNORMAL TASK TERMINATION.
ERROR CODE '(CMD1011)': /HELP-MSG (CMD1011)
TTL or PTL reached in interactive job
The CPU time for an interactive task is not usually limited. However, systems support can use the system parameter DIATTL (DIAlog Task Time Limit) to restrict the CPU time depending on the TTL. DIATTL can have the value Y, N or Q:
DIATTL=N (default)
The interactive task is terminated on task time runout.If TTL is exceeded when no program is loaded then message
EXC0067
is output and the user can continue to work for 30 CPU seconds until the process is repeated.
EXC0067 CPU TIME SPECIFIED IN /SET-LOGON-PARAMETERS EXCEEDED.
TASK CONTINUEDIf a program is loaded, the following applies if TTL or PTL is exceeded:
In procedure mode, message
EXC0068
is output and execution continues. The time limit is increased by 30 CPU seconds, i.e. the process subsequently repeats itself.
EXC0068 CPU TIME SPECIFIED AT PROGRAM START EXCEEDED. PROGRAM CONTINUEDIn interactive mode, message
EXC0075
is output for a program without a defined STXIT routine for the “end of program runtime” event class. The user can specify whether execution is to be resumed or terminated. If execution is resumed, the process repeats itself after 30 CPU seconds.
EXC0075 TIME LIMIT FOR PROGRAM RUN EXCEEDED. PROGRAM TO BE CONTINUED?
REPLY (Y=YES; N=NO)If a program has an STXIT routine, it is started. The task is given 30 additional CPU seconds to process the routine. If the STXIT does not terminate the program, it passes control back to the program. If the allowed 30 CPU seconds have not been used, the program continues running until this new time limit is exceeded. The following two messages are then output:
EXC0073 MAXIMUM PROGRAM RUNTIME EXCEEDED. 'STXIT' ROUTINE OR PROGRAM RUN USED UP 30 SECONDS. EXC0075 TIME LIMIT FOR PROGRAM RUN EXCEEDED. PROGRAM TO BE CONTINUED? REPLY (Y=YES; N=NO)
The user can specify whether execution is to be resumed or terminated. If execution is resumed, the process repeats itself after 30 CPU seconds.
DIATTL=Y
The interactive task is terminated with a task time runout.If the TTL is exceeded, message
EXC0076
is first output:
EXC0076 TASK CPU TIME LIMIT for DIALOG TASK exceeded.
Task will be terminated after 30 sec extra CPU-time.If there is a program run with STXIT for timeout, this STXIT routine is started after the expiration of the period provided for by the message. By default, a further 30 CPU seconds is allowed for the STXIT routine.
DIATTL=Q (quick and quiet)
The interactive task is terminated with a task time runout (as with DIATTL=Y).In addition (also for a batch job), for both TTL and PTL all aforementioned additional times and/or wait times will be reduced to one second (“quick”) and the message
EXC0070
which is waiting for an answer is suppressed on the console (“quiet”).