Skip to main content

Can a job that is in the input queue or which is currently executing be killed from the command line in Enterprise Server JCL?

Problem:

How do you kill an Enterprise Server JCL job from the command line, even if the job is already in the input queue or currently executing?

Resolution:

A job that is in the input queue or which is currently executing may be killed by using the "CASOUT" command.   For example:

casout -r<servername> -k<job#>

casout -s<protocol:ip-addr:port> -k<job#>

casout -l<servername> -k<job#>

Our architecture's design is such that we first attempt a "soft kill" in which the process is notified that we would like it to go away.  If the batch initiator can terminate the job at that point in time then the JCL batch initiator terminates the user program, issues the appropriate S222 abend message and then the job terminates.   

The JCL batch initiator process continues to run and processes the next available job. There are some cases (outstanding accept from console being one of them) where our "soft kill" doesn't work.  In those cases the process is marked such that the next "kill" that comes in causes a "hard kill".  In this form of "kill" we actually use the operating system's API calls to "kill" the actual process.   When this happens, the batch initiator will cease to exist and a new one will be restarted by Enterprise Server.

The recommended approach from the architects is to issue the first kill and monitor for the termination of the job via the event manager.  If, after what you view as an appropriate period of time, you have not received a notification that the job was killed then you should issue a second kill which will trigger our "hard kill" processing.

Old KB# 13999

#EnterpriseServer
#Server
#Enterprise
#COBOL
#ServerExpress