CL Command Reference - ENDSBS

CL Command List > ENDSBS Reference

Description:

The End Subsystem (ENDSBS) command ends the specified subsystem (or all active subsystems) and specifies what happens to active work being processed. No new jobs or routing steps are started in the subsystem or subsystems after this command is run.

Interactive jobs that have been transferred to a job queue by the Transfer Job (TFRJOB) command are ended as part of ending the subsystem. If an initial program load (IPL) occurs while either a batch or interactive job is on a job queue (because of the TFRJOB command), that job is removed from the job queue during IPL and its job log is produced.

You can specify that the application programs running in the subsystem are given time to control end-of-job processing. If no time is given or if cleanup cannot be performed within the given time, the system performs minimal end-of-job processing, which can include:
. Closing the database files.
. Spooling the job log to an output queue.
. Cleaning up internal objects in the operating system.
. Showing the end-of-job display (for interactive jobs).
. Completing commitment control processing.

Restrictions:

1. To use this command, you must have:
. job control (*JOBCTL) special authority.
. object operational (*OBJOPR) and read (*READ) authority to the subsystem description associated with the specified subsystem.

2. If the controlling subsystem is being ended, because either its name or *ALL is specified for the Subsystem (SBS) parameter, then this command can be run only in
. an interactive job that is in the controlling subsystem and only from a work station (associated with the interactive job) whose work station entry in the controlling subsystem description specifies *SIGNON for the Allocation (AT) parameter. For more information, see the Add Work Station Entry (ADDWSE) command.
. or a batch job running in the controlling subsystem, initiated from a job queue, with the BCHTIMLMT parameter and SBS(*ALL) specified.
ENDSBS SBS(*ALL) is not allowed in a TELNET job, pass-through job, or in a workstation function job.

3. ENDSBS SBS(*ALL) is not allowed in a batch job that allows multiple threads.


Examples:

ENDSBS SBS(QBATCH) OPTION(*CNTRLD) DELAY(60)

This command ends all active jobs in the QBATCH subsystem and ends the subsystem. The active jobs are allowed 60 seconds to perform application-provided end-of-job processing.