ENDSBS (End Subsystem)
Purpose
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 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.
Restrictions
- If the controlling subsystem is being ended, because either its name or *ALL is specified for the SBS parameter, this command can be entered only in an interactive job. The interactive job must be in the controlling subsystem, and the command can be entered only from a work station (associated with the interactive job) whose work station entry in the controlling subsystem description specifies AT(*SIGNON).
- You must have job control (*JOBCTL) authority and object operational authority to the subsystem to use this command.
Required Parameters
- SBS
- Specifies the name of the subsystem to be ended, or it specifies that all active subsystems are to be ended.
*ALL: All the subsystems that are currently active are ended. All jobs are ended except the job in which this command is entered. When this value is specified, the QSYSOPR message queue should be in break delivery mode in the job issuing the ENDSBS command.
subsystem-name: Specify the simple name of the subsystem to be ended.
Note: If the subsystem specified is the controlling subsystem, the interactive job from which the command was issued remains active. Also, if the subsystem specified is the controlling subsystem and the job that issues this command is one of two jobs that are active at the work station (through the use of the system request key or the Transfer Secondary Job (TFRSECJOB) command), neither of the jobs is forced to end. The controlling subsystem does not end until you end one of the jobs (either by signing off in one job or by ending one job from the other).
Optional Parameters
- OPTION
- Specifies whether jobs in the subsystem are ended in a controlled manner, which means that the application programs running in the subsystem are given time to perform end-of-job processing, or are ended immediately. In either case, the system performs certain cleanup processing.
*CNTRLD: The jobs are ended in a controlled manner. This allows the programs that are running to perform cleanup (end of job processing). The applications have the amount of time specified on the DELAY parameter to complete cleanup before the job is ended.
*IMMED: The jobs are ended immediately and the system performs end-of-job cleanup. System cleanup can take from a brief amount of time to several minutes.
Note: This value is recommended only if specifying the *CNTRLD value has been unsuccessful. When you specify the *IMMED value, you can get undesirable results, for example, from data that has been partially updated.
- DELAY
- Specifies the amount of time (in seconds) allowed in which to complete a controlled subsystem end operation. If this amount of time is exceeded, any jobs still running in the subsystem are ended immediately.
*NOLIMIT: The amount of time in which to complete a controlled end operation is not limited.
delay-time: Specify the number of seconds in which the end operation is completed. Valid values range from 1 through 99999 seconds.
- ENDSBSOPT
- Specifies the options to take when ending the active subsystems. In general, specifying these options will improve the performance of the ENDSBS command. Each option has certain side effects that you need to analyze before using that option.
This parameter has no effect on jobs that are already in the ending status.
*DFT: The subsystems will end with no special ending options.
- Joblogs will be produced.
- The run priority will not change.
- The timeslice value will not change.
*NOJOBLOG: No joblogs will be created for jobs that are ended due to this command being invoked. This includes subsystem monitor jobs and all user jobs in the subsystem. This option can significantly reduce the amount of time necessary to complete the ENDSBS command. However, if a problem occurs in a job, there will be no joblog to record the problem, which may make problem diagnosis difficult or impossible.
*CHGPTY: The CPU priority of jobs that are ending is changed to a higher value (worse priority). The remaining active jobs on the system may have better performance when *CHGPTY is specified. However, jobs that are ending may take longer to finish. This option is ignored if the subsystem is ending controlled. But if the DELAY time limit expires, this option will take affect immediately.
*CHGTSL: The timeslice of jobs that are ending is changed to a lower value. The remaining active jobs on the system may have better performance when *CHGTSL is specified. However, jobs that are ending may take longer to finish. This option is ignored if the subsystem is ending controlled. But if the DELAY time limit expires, this option will take affect immediately.
Note: Specifying *CHGPTY and *CHGTSL will reduce the impact on other active jobs on the system, but this may cause undesirable delays if there are active workstations that were allocated to the ending subsystem. It may take longer for those workstations to have their signon screens re-displayed since the job using the display must end before the workstation is ready to be allocated to another subsystem. Example for ENDSBS
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.
Error messages for ENDSBS
*ESCAPE Messages
- CPF1001
- Wait time expired for system response.
- CPF1032
- System ending with *CNTRLD option.
- CPF1033
- System ending with *IMMED option.
- CPF1034
- All subsystems ending with *CNTRLD option.
- CPF1035
- Subsystems ending with *IMMED option.
- CPF1036
- System powering down with *CNTRLD option.
- CPF1037
- System powering down with *IMMED option.
- CPF1038
- No authority to use command.
- CPF1052
- ENDSBS *ALL not allowed in current environment.
- CPF1053
- Ending controlling subsystem &1 not allowed.
- CPF1054
- No subsystem &1 active.
- CPF1055
- Subsystem &1 ending with *CNTRLD option.
- CPF1056
- Subsystem &1 already ending with *IMMED option.
- CPF1081
- Controlling subsystem already ending to a single job.
- CPF1091
- Function check occurred in system arbiter.