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

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.

Type
*NAME
Required
Yes
Length
10
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*CNTRLD
Length
7
Case
Uppercase

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.

Type
*INT4
Required
No
Default
*NOLIMIT
Range
0 to 99999
Case
Uppercase

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.

Type
*CHAR
Required
No
Default
*DFT
Length
9
List limit
3
Case
Uppercase

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.

Type
*INT4
Required
No
Range
5 to 9999
Case
Uppercase

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.

Type
*INT4
Required
No
Range
10 to 999
Case
Uppercase

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.

IBM command documentation

Generated from os/cl/catalog/ENDSBS.json and os/cl/help/ENDSBS.json.