Command reference / job
ENDSBS
End Subsystem
Ends the specified subsystem, or all active subsystems, and specifies what happens to active work. No new jobs or routing steps start in the subsystem after this command runs. Interactive jobs transferred to a job queue by TFRJOB are ended as part of ending the subsystem; if an IPL occurs while such a job is queued, it is removed and its job log is produced. Application programs can be given time for controlled end-of-job processing. If no time is given, or cleanup cannot finish in time, minimal end-of-job processing runs: closing database files, spooling the job log, cleaning up internal objects, showing the end-of-job display for interactive jobs, and completing commitment control processing.
Allowed environments: *ALL.
Positional parameters: 2.
Restrictions
- To use this command, you must have job control (*JOBCTL) special authority.
- If the controlling subsystem is being ended (by its name or by *ALL), the command can run only from an interactive job in the controlling subsystem at a work station whose work station entry specifies *SIGNON for the AT parameter, or from a batch job in the controlling subsystem started from a job queue with BCHTIMLMT and SBS(*ALL) specified. ENDSBS SBS(*ALL) is not allowed in a TELNET job, pass-through job, or workstation function job.
- ENDSBS SBS(*ALL) is not allowed in a batch job that allows multiple threads.
Parameters
SBS
Subsystem
Specifies the name of the subsystem to be ended, or that all active subsystems are to be ended. This is a required parameter.
Suggested / special values:
*ALL
*ALL- All currently active subsystems are ended, and all jobs except the job issuing the command. QSYSOPR should be in break delivery mode in the issuing job.
OPTION
How to end
Specifies whether jobs in the subsystem are ended in a controlled manner, letting application programs perform end-of-job processing, or immediately.
Allowed values:
*CNTRLD, *IMMED
*CNTRLD- Jobs end in a controlled manner, so programs can perform cleanup within the DELAY time.
*IMMED- Jobs end immediately. Programs cannot clean up except by handling SIGTERM. Can cause undesirable results if data is partially updated, so use only after a controlled end has been tried unsuccessfully.
DELAY
Controlled end delay time
Specifies the time in seconds allowed to complete the controlled subsystem end. If exceeded, any jobs still being processed in the subsystem are ended immediately.
Suggested / special values:
*NOLIMIT
*NOLIMIT- The time allowed to complete a controlled end is not limited.
ENDSBSOPT
End subsystem option
Specifies the options to take when ending the active subsystems. In general these improve ENDSBS performance, but each has side effects that should be analyzed before use.
Allowed values:
*DFT, *NOJOBLOG, *CHGPTY, *CHGTSL
*DFT- Subsystems end with no special options: joblogs are produced, and the run priority and timeslice do not change.
*NOJOBLOG- No joblogs are created for jobs ended by this command. This can speed up ENDSBS but makes problem diagnosis harder.
*CHGPTY- The CPU priority of ending jobs is changed to a worse value, so remaining jobs may perform better while ending jobs take longer.
*CHGTSL- The timeslice of ending jobs is changed to a lower value, so remaining jobs may perform better while ending jobs take longer.
BCHTIMLMT
Batch time limit
Specifies the time in minutes the system runs in batch restricted state. Valid only when ending all subsystems from a batch job running in the controlling subsystem, in which case a value must be specified.
Suggested / special values:
*NOMAX
*NOMAX- There is no time limit for the batch restricted function. The system stays restricted until the job ends, STRSBS is used, or the DST option to end batch restricted state is used.
ABNENDDLY
Abnormal end delay time
Specifies the time in minutes allowed for the immediate subsystem end to complete. If exceeded, jobs still being processed are ended abnormally, and the next system end is marked as abnormal.
Suggested / special values:
*NOLIMIT
*NOLIMIT- The time allowed to complete an immediate end is not limited.
Examples
ENDSBS SBS(QBATCH) OPTION(*CNTRLD) DELAY(60)
Ends all active jobs in the QBATCH subsystem and ends the subsystem. Active jobs are allowed 60 seconds for application-provided end-of-job processing.
Generated from os/cl/catalog/ENDSBS.json and os/cl/help/ENDSBS.json.